4

我是 Android 版 COCOS2D 的新手,在尝试运行 cocos2d 提供的示例项目(HelloWorld)时,我得到了“FATAL EXCEPTION: main”,详细信息到达了 LogCat

05-31 19:11:46.920: E/AndroidRuntime(7719): FATAL EXCEPTION: main
05-31 19:11:46.920: E/AndroidRuntime(7719): java.lang.ExceptionInInitializerError
05-31 19:11:46.920: E/AndroidRuntime(7719):     at java.lang.Class.newInstanceImpl(Native Method)
05-31 19:11:46.920: E/AndroidRuntime(7719):     at java.lang.Class.newInstance(Class.java:1429)
05-31 19:11:46.920: E/AndroidRuntime(7719):     at android.app.Instrumentation.newActivity(Instrumentation.java:1023)
05-31 19:11:46.920: E/AndroidRuntime(7719):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)
05-31 19:11:46.920: E/AndroidRuntime(7719):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
05-31 19:11:46.920: E/AndroidRuntime(7719):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)
05-31 19:11:46.920: E/AndroidRuntime(7719):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
05-31 19:11:46.920: E/AndroidRuntime(7719):     at android.os.Handler.dispatchMessage(Handler.java:99)
05-31 19:11:46.920: E/AndroidRuntime(7719):     at android.os.Looper.loop(Looper.java:123)
05-31 19:11:46.920: E/AndroidRuntime(7719):     at android.app.ActivityThread.main(ActivityThread.java:4627)
05-31 19:11:46.920: E/AndroidRuntime(7719):     at java.lang.reflect.Method.invokeNative(Native Method)
05-31 19:11:46.920: E/AndroidRuntime(7719):     at java.lang.reflect.Method.invoke(Method.java:521)
05-31 19:11:46.920: E/AndroidRuntime(7719):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
05-31 19:11:46.920: E/AndroidRuntime(7719):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
05-31 19:11:46.920: E/AndroidRuntime(7719):     at dalvik.system.NativeStart.main(Native Method)
05-31 19:11:46.920: E/AndroidRuntime(7719): Caused by: java.lang.UnsatisfiedLinkError: Library helloworld not found
05-31 19:11:46.920: E/AndroidRuntime(7719):     at java.lang.Runtime.loadLibrary(Runtime.java:461)
05-31 19:11:46.920: E/AndroidRuntime(7719):     at java.lang.System.loadLibrary(System.java:557)
05-31 19:11:46.920: E/AndroidRuntime(7719):     at org.cocos2dx.application.ApplicationDemo.<clinit>(ApplicationDemo.java:81)
05-31 19:11:46.920: E/AndroidRuntime(7719):     ... 15 more

所以任何人都可以帮助一些想法/解决方案。我再次遵循来自“http://www.multigesture.net/articles/how-to-setup-cocos2d-x-windows-and-android/”的参考

非常感谢。

4

1 回答 1

2

我建议您将库更改为 cocos2d-x,因为 cocos2d for android 将不再更新。

Cocos2d-x 在 C++ 中工作,并使用 JNI(Java 原生接口)来工作。是您开始使用它所需的所有信息。

于 2012-05-31T13:55:07.943 回答