1

我正在关注适用于 iOS 和 Android 的 Cocos2D-X:Raywenderlich 网站的入门教程。

如网站所述,我已经从 create-android-project.sh 命令下载了 android 项目。当我尝试在 Eclipse 中运行该项目时,我得到了以下日志:

09-26 13:04:05.081: W/dalvikvm(517): Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lcom/a/samplecocos2dxandroid21;
09-26 13:04:05.081: W/dalvikvm(517): Class init failed in newInstance call (Lcom/a/samplecocos2dxandroid21;)
09-26 13:04:05.081: D/AndroidRuntime(517): Shutting down VM
09-26 13:04:05.081: W/dalvikvm(517): threadid=1: thread exiting with uncaught exception (group=0x409c01f8)
09-26 13:04:05.091: E/AndroidRuntime(517): FATAL EXCEPTION: main
09-26 13:04:05.091: E/AndroidRuntime(517): java.lang.ExceptionInInitializerError
09-26 13:04:05.091: E/AndroidRuntime(517):  at java.lang.Class.newInstanceImpl(Native Method)
09-26 13:04:05.091: E/AndroidRuntime(517):  at java.lang.Class.newInstance(Class.java:1319)
09-26 13:04:05.091: E/AndroidRuntime(517):  at android.app.Instrumentation.newActivity(Instrumentation.java:1023)
09-26 13:04:05.091: E/AndroidRuntime(517):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1871)
09-26 13:04:05.091: E/AndroidRuntime(517):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
09-26 13:04:05.091: E/AndroidRuntime(517):  at android.app.ActivityThread.access$600(ActivityThread.java:123)
09-26 13:04:05.091: E/AndroidRuntime(517):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
09-26 13:04:05.091: E/AndroidRuntime(517):  at android.os.Handler.dispatchMessage(Handler.java:99)
09-26 13:04:05.091: E/AndroidRuntime(517):  at android.os.Looper.loop(Looper.java:137)
09-26 13:04:05.091: E/AndroidRuntime(517):  at android.app.ActivityThread.main(ActivityThread.java:4424)
09-26 13:04:05.091: E/AndroidRuntime(517):  at java.lang.reflect.Method.invokeNative(Native Method)
09-26 13:04:05.091: E/AndroidRuntime(517):  at java.lang.reflect.Method.invoke(Method.java:511)
09-26 13:04:05.091: E/AndroidRuntime(517):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
09-26 13:04:05.091: E/AndroidRuntime(517):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
09-26 13:04:05.091: E/AndroidRuntime(517):  at dalvik.system.NativeStart.main(Native Method)
09-26 13:04:05.091: E/AndroidRuntime(517): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load game: findLibrary returned null 
09-26 13:04:05.091: E/AndroidRuntime(517):  at java.lang.Runtime.loadLibrary(Runtime.java:365)   
09-26 13:04:05.091: E/AndroidRuntime(517):  at java.lang.System.loadLibrary(System.java:535)
09-26 13:04:05.091: E/AndroidRuntime(517):  at com.a.samplecocos2dxandroid21.<clinit>(samplecocos2dxandroid21.java:106)
09-26 13:04:05.091: E/AndroidRuntime(517):  ... 15 more

android ndk,android sdk 路径设置和更改 create-android-project.sh 已经完成。有人可以告诉我我错在哪里以及解决方案是什么......

4

1 回答 1

1

您没有运行 build_native.sh,因此您的游戏没有构建到共享库,这就是它抱怨找不到库的原因

于 2012-09-26T22:59:54.360 回答