我刚刚完成了我的第一个 cocos2d-x 游戏。我已经在我的 GNexus 4.1 和其他较低版本的设备(包括平板电脑)上对其进行了测试。然而,当购买并下载到 Nexus 7 时,它甚至无法打开。它运行的是 4.2,这可能是问题吗? 任何帮助,将不胜感激。 崩溃报告:
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
最佳答案
有许多应用程序都遇到此错误。它发生在 Android 4.2 上,项目是使用特定的 Android NDK 编译的 - 对我来说它是 r8d,但您也可以找到使用其他版本且存在该错误的人。提到了我发现的解决方法here 。解决方案是在任何 .cpp
文件中添加以下代码行:
#ifdef __cplusplus
extern "C" {
#endif
void __exidx_start() {}
void __exidx_end() {}
#ifdef __cplusplus
}
#endif
对我来说它有效。
但我认为你必须小心,因为在未来版本的 NDK 中,当他们最终修复这个问题时,这些符号可能会被定义两次,所以这个解决方法实际上会转化为一个错误。
关于java - Play 商店刚下架的 Cocos2D-x 游戏根本打不开,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13555376/