在运行安卓版COCOS2D时,出现了致命异常:主线程。

4

我是COCOS2D for Android的新手,在尝试运行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/”

非常感谢。

1个回答

2
我建议你将库更改为cocos2d-x,因为android上的cocos2d不再更新。
Cocos2d-x使用C++编写,并使用JNI(Java本机接口)进行操作。这里提供了您开始使用它所需的所有信息:https://dev59.com/DOo6XIcBkEYKwwoYQiO7

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接