Home > other >  For help, coco2dx - the lua project access baidu map SDK application starts at initGPS collapse prob
For help, coco2dx - the lua project access baidu map SDK application starts at initGPS collapse prob

Time:09-18

Cocos2dx - the lua project in c + + part for ios access baidu map SDK, when they start the program in
 - (void) initGPS 
{
Init _mapManager=[[BMKMapManager alloc]];
Self. OpenGPSState=0;
}


This code crash, if the AppDelegate.
in the CPP
//register lua module 
Auto engine=LuaEngine: : getInstance ();
ScriptEngineManager: : getInstance () - & gt; SetScriptEngine (engine);
Lua_State * L=engine - & gt; GetLuaStack () - & gt; GetLuaState ();
Lua_module_register (L);
Register_all_LuaDataBridge (L);
LuaStack * stack=engine - & gt; GetLuaStack ();
Stack - & gt; Dxlua setXXTEAKeyAndSign (" 2 ", strlen (" 2 dxlua "), "XXTEA strlen (" XXTEA"));


Comment out a string of code does not collapse, normal boot, but crash program is not running on this string of code, who know what the problem, please feel free to comment

CodePudding user response:

To follow after, detection is lua_module_register (L); The function of register_network_module (L); Part of functions, including registered webcoskcet
 # if (CC_TARGET_PLATFORM==CC_PLATFORM_IOS | | CC_TARGET_PLATFORM==CC_PLATFORM_ANDROID | | CC_TARGET_PLATFORM==CC_PLATFORM_WIN32 | | CC_TARGET_PLATFORM==CC_PLATFORM_MAC) 
Tolua_web_socket_open (L);
Register_web_socket_manual (L);
# endif

But this one step to track track not bottom go to, as long as the two functions in, even if the function of the operations are commented out will collapse

CodePudding user response:

The error stack and type of hair, you like this it's hard to see,

CodePudding user response:

refer to the second floor lovesmiles response:
the error stack and type of hair, do you like this it's hard to see problems,

Hello, this is the collapse of the screenshot




CodePudding user response:

Error prompt "Thread 1: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0 x0)"

CodePudding user response:

Poor judgment, some of the reasons for this error,
Do you use real machine or simulator debugging?
1 suggested real machine debugging,
Suggest an error code of points 2 sections, don't write one line of code is too much,
3 more pointer null judgments,

Others also can't help you, this is the framework of an error,

CodePudding user response:

reference 5 floor lovesmiles reply:
bad judgement, some of the reasons for this error,
Do you use real machine or simulator debugging?
1 suggested real machine debugging,
Suggest an error code of points 2 sections, don't write one line of code is too much,
3 more pointer null judgments,

Others also can't help you, this is the error framework,

Thank you, because there is no reason, have been turned to gold tried, the results did not appear this problem, simply change the SDK,
  • Related