更新
我解决了我的问题。问题是区分3.0和2.0版本cocos2d-x。对于版本2.0,.java文件必须是以下代码
static
{
System.loadLibrary("cocos2dcpp");
}
也许这对某些人有用。
我编译了应用程序没有错误,但在我的设备上运行应用程序后,我有一个奇怪的错误。
05-22 08:43:38.477: E/AndroidRuntime(1493): FATAL EXCEPTION: main
05-22 08:43:38.477: E/AndroidRuntime(1493): java.lang.UnsatisfiedLinkError: Native method not found: org.cocos2dx.lib.Cocos2dxHelper.nativeSetApkPath:(Ljava/lang/String;)V
05-22 08:43:38.477: E/AndroidRuntime(1493): at org.cocos2dx.lib.Cocos2dxHelper.nativeSetApkPath(Native Method)
05-22 08:43:38.477: E/AndroidRuntime(1493): at org.cocos2dx.lib.Cocos2dxHelper.init(Cocos2dxHelper.java:71)
05-22 08:43:38.477: E/AndroidRuntime(1493): at org.cocos2dx.lib.Cocos2dxActivity.onCreate(Cocos2dxActivity.java:68)
05-22 08:43:38.477: E/AndroidRuntime(1493): at com.newhope.barman.barman.onCreate(barman.java:99)
05-22 08:43:38.477: E/AndroidRuntime(1493): at android.app.Activity.performCreate(Activity.java:5133)
05-22 08:43:38.477: E/AndroidRuntime(1493): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
05-22 08:43:38.477: E/AndroidRuntime(1493): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2175)
05-22 08:43:38.477: E/AndroidRuntime(1493): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
05-22 08:43:38.477: E/AndroidRuntime(1493): at android.app.ActivityThread.access$600(ActivityThread.java:141)
05-22 08:43:38.477: E/AndroidRuntime(1493): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
05-22 08:43:38.477: E/AndroidRuntime(1493): at android.os.Handler.dispatchMessage(Handler.java:99)
05-22 08:43:38.477: E/AndroidRuntime(1493): at android.os.Looper.loop(Looper.java:137)
05-22 08:43:38.477: E/AndroidRuntime(1493): at android.app.ActivityThread.main(ActivityThread.java:5103)
05-22 08:43:38.477: E/AndroidRuntime(1493): at java.lang.reflect.Method.invokeNative(Native Method)
05-22 08:43:38.477: E/AndroidRuntime(1493): at java.lang.reflect.Method.invoke(Method.java:525)
05-22 08:43:38.477: E/AndroidRuntime(1493): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
05-22 08:43:38.477: E/AndroidRuntime(1493): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
05-22 08:43:38.477: E/AndroidRuntime(1493): at dalvik.system.NativeStart.main(Native Method)
请告诉我,我做错了什么?谢谢你的帮助!