我正在关注集成 swarm 和 libgdx 的教程。链接在这里http://swarmconnect.com/admin/docs/libgdx。
我下载了源代码提供http://swarmconnect.com/login?redirect=%2Fimages%2Fdocs%2Fexample_libgdx_swarm_done.zip。建造时没有发生任何错误。当我尝试在模拟器中运行 android 应用程序时,会弹出“不幸的是,XXX 已停止”。而logcat是
06-04 20:58:37.107: I/dalvikvm(739): threadid=3: reacting to signal 3
06-04 20:58:37.237: I/dalvikvm(739): Wrote stack traces to '/data/anr/traces.txt'
06-04 20:58:37.553: D/(739): HostConnection::get() New Host Connection established 0x15c610, tid 739
06-04 20:58:37.637: I/dalvikvm(739): threadid=3: reacting to signal 3
06-04 20:58:37.657: I/dalvikvm(739): Wrote stack traces to '/data/anr/traces.txt'
06-04 20:58:40.808: I/dalvikvm(739): Could not find method com.swarmconnect.Swarm.setActive, referenced from method com.badlogicgames.superjumper.SuperJumperAndroid.onCreate
06-04 20:58:40.817: W/dalvikvm(739): VFY: unable to resolve static method 9558: Lcom/swarmconnect/Swarm;.setActive (Landroid/app/Activity;)V
06-04 20:58:40.817: D/dalvikvm(739): VFY: replacing opcode 0x71 at 0x000c
06-04 20:58:40.817: I/dalvikvm(739): Could not find method com.swarmconnect.Swarm.setInactive, referenced from method com.badlogicgames.superjumper.SuperJumperAndroid.onPause
06-04 20:58:40.817: W/dalvikvm(739): VFY: unable to resolve static method 9559: Lcom/swarmconnect/Swarm;.setInactive (Landroid/app/Activity;)V
06-04 20:58:40.817: D/dalvikvm(739): VFY: replacing opcode 0x71 at 0x0003
06-04 20:58:40.827: I/dalvikvm(739): Could not find method com.swarmconnect.Swarm.setActive, referenced from method com.badlogicgames.superjumper.SuperJumperAndroid.onResume
06-04 20:58:40.827: W/dalvikvm(739): VFY: unable to resolve static method 9558: Lcom/swarmconnect/Swarm;.setActive (Landroid/app/Activity;)V
06-04 20:58:40.827: D/dalvikvm(739): VFY: replacing opcode 0x71 at 0x0003
06-04 20:58:40.847: D/dalvikvm(739): Trying to load lib /data/data/com.badlogicgames.superjumper/lib/libgdx.so 0x412a0128
06-04 20:58:40.847: D/dalvikvm(739): Added shared lib /data/data/com.badlogicgames.superjumper/lib/libgdx.so 0x412a0128
06-04 20:58:40.847: D/dalvikvm(739): No JNI_OnLoad found in /data/data/com.badlogicgames.superjumper/lib/libgdx.so 0x412a0128, skipping init
06-04 20:58:40.927: D/AndroidRuntime(739): Shutting down VM
06-04 20:58:40.927: W/dalvikvm(739): threadid=1: thread exiting with uncaught exception (group=0x409c01f8)
06-04 20:58:40.947: E/AndroidRuntime(739): FATAL EXCEPTION: main
06-04 20:58:40.947: E/AndroidRuntime(739): java.lang.NoClassDefFoundError: com.swarmconnect.Swarm
06-04 20:58:40.947: E/AndroidRuntime(739): at com.badlogicgames.superjumper.SuperJumperAndroid.onCreate(SuperJumperAndroid.java:33)
06-04 20:58:40.947: E/AndroidRuntime(739): at android.app.Activity.performCreate(Activity.java:4465)
06-04 20:58:40.947: E/AndroidRuntime(739): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
06-04 20:58:40.947: E/AndroidRuntime(739): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
06-04 20:58:40.947: E/AndroidRuntime(739): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
06-04 20:58:40.947: E/AndroidRuntime(739): at android.app.ActivityThread.access$600(ActivityThread.java:123)
06-04 20:58:40.947: E/AndroidRuntime(739): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
06-04 20:58:40.947: E/AndroidRuntime(739): at android.os.Handler.dispatchMessage(Handler.java:99)
06-04 20:58:40.947: E/AndroidRuntime(739): at android.os.Looper.loop(Looper.java:137)
06-04 20:58:40.947: E/AndroidRuntime(739): at android.app.ActivityThread.main(ActivityThread.java:4424)
06-04 20:58:40.947: E/AndroidRuntime(739): at java.lang.reflect.Method.invokeNative(Native Method)
06-04 20:58:40.947: E/AndroidRuntime(739): at java.lang.reflect.Method.invoke(Method.java:511)
06-04 20:58:40.947: E/AndroidRuntime(739): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
06-04 20:58:40.947: E/AndroidRuntime(739): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
06-04 20:58:40.947: E/AndroidRuntime(739): at dalvik.system.Nati
veStart.main(Native Method)
06-04 20:58:41.277: I/dalvikvm(739): threadid=3: reacting to signal 3
06-04 20:58:41.308: I/dalvikvm(739): Wrote stack traces to '/data/anr/traces.txt'
06-04 20:58:41.557: I/dalvikvm(739): threadid=3: reacting to signal 3
06-04 20:58:41.577: I/dalvikvm(739): Wrote stack traces to '/data/anr/traces.txt'
它说
06-04 20:58:40.808: I/dalvikvm(739): Could not find method com.swarmconnect.Swarm.setActive, referenced from method com.badlogicgames.superjumper.SuperJumperAndroid.onCreate
06-04 20:58:40.817: W/dalvikvm(739): VFY: unable to resolve static method 9558: Lcom/swarmconnect/Swarm;.setActive (Landroid/app/Activity;)V
06-04 20:58:40.817: D/dalvikvm(739): VFY: replacing opcode 0x71 at 0x000c
06-04 20:58:40.817: I/dalvikvm(739): Could not find method com.swarmconnect.Swarm.setInactive, referenced from method com.badlogicgames.superjumper.SuperJumperAndroid.onPause
06-04 20:58:40.817: W/dalvikvm(739): VFY: unable to resolve static method 9559: Lcom/swarmconnect/Swarm;.setInactive (Landroid/app/Activity;)V
但我将 swarm 项目添加到 superjumper-android 项目中。有人遇到过类似的问题吗?