我是COCOS2D for Android的新手,在尝试运行cocos2d提供的示例项目(HelloWorld)时,我得到了“FATAL EXCEPTION:main”并且详细到达了LogCat 05-31 19:11:46.920: E/AndroidRuntime(7719): FATAL EXCEPTION: main05-31 19:11:4
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/”
非常感谢.
我建议你将库更改为cocos2d-x,因为android的cocos2d将不再更新.Cocos2d-x在C中工作,并使用JNI(Java本机接口)工作. Here是您开始使用它所需的所有信息.