的Cocos2D-X游戏断食Play商店甚至无法打开无法打开、商店、断食、游戏

2023-09-05 23:20:14 作者:找不到根據地

我刚刚完成我的第一次的cocos2d-X的游戏。我已经在我的GNexus 4.1等较低的设备,包括平板电脑进行了测试。然而,买的时候并下载到一台Nexus 7,它甚至不会开放。它的运行4.2,会是这个问题? 任何帮助将是AP preciated。 崩溃报告:

  java.lang.ExceptionInInitializerError
在java.lang.Class.newInstanceImpl(本机方法)
在java.lang.Class.newInstance(Class.java:1319)
在android.app.Instrumentation.newActivity(Instrumentation.java:1054)
在android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2097)
在android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
在android.app.ActivityThread.access $ 600(ActivityThread.java:141)
在android.app.ActivityThread $ H.handleMessage(ActivityThread.java:1234)
在android.os.Handler.dispatchMessage(Handler.java:99)
在android.os.Looper.loop(Looper.java:137)
在android.app.ActivityThread.main(ActivityThread.java:5039)
在java.lang.reflect.Method.invokeNative(本机方法)
在java.lang.reflect.Method.invoke(Method.java:511)
在com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:793)
在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
在dalvik.system.NativeStart.main(本机方法)
java.lang.UnsatisfiedLinkError中:产生的原因无法加载库:soinfo_relocate(linker.cpp:975):无法找到符号__exidx_end由libgame.so引用...
在java.lang.Runtime.loadLibrary(Runtime.java:371)
在java.lang.System.loadLibrary(System.java:535)
在com.penguinproductions.classiclightcycles< clinit>(classiclightcycles.java:107)
... 15更多
 

解决方案

有许多应用程序从这个错误而受到影响。它发生在Android 4.2,使用特定的Andr​​oid NDK编译的项目 - 对我来说这是r8d,但你也可以找到人与其他版本的与错误。解决方法我发现被提及。解决的办法是在你的任何的.cpp 文件添加的code如下:

 的#ifdef __cplusplus
    为externC{
#ENDIF

空隙__exidx_start(){}
空隙__exidx_end(){}

的#ifdef __cplusplus
    }
#ENDIF
 
实操基于cocos2d x游戏项目 编译底层代码静态库 4.0 四

对于我来说它的工作。

但我认为你必须小心,因为在NDK的未来版本中,当他们终于解决这个问题,这些符号可能会被定义两次,所以这个解决方法将变身为一个错误,其实。

I just finished my first cocos2d-x game. I've tested it on my GNexus 4.1 and other lower devices, including tablets. However, when bought and downloaded to a Nexus 7, it won't even open. It's running 4.2, could that be the issue? Any help would be appreciated. crash report:

java.lang.ExceptionInInitializerError
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1319)
at android.app.Instrumentation.newActivity(Instrumentation.java:1054)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2097)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5039)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.UnsatisfiedLinkError: Cannot load library:     soinfo_relocate(linker.cpp:975): cannot locate symbol "__exidx_end" referenced by               "libgame.so"...
at java.lang.Runtime.loadLibrary(Runtime.java:371)
at java.lang.System.loadLibrary(System.java:535)
at com.penguinproductions.classiclightcycles.<clinit>(classiclightcycles.java:107)
... 15 more

解决方案

There are many application which suffer from this error. It occurs on Android 4.2 with project compiled using specific Android NDK - for me it was r8d, but you can find also people with other versions with that bug. Workaround I found is mentioned here. The solution is to add following lines of code in any of your .cpp files:

#ifdef __cplusplus
    extern "C" {
#endif

void __exidx_start() {}
void __exidx_end()   {}

#ifdef __cplusplus
    }
#endif

For me it worked.

But I think you must watch out, because in future version of NDK, when they finally fix this, these symbols might be defined twice, so this workaround will transform into a bug, actually.