每當我試圖在模擬器上執行的應用程序,仿真器顯示錯誤說:「不幸的是,我的libGDX遊戲已經停止。」儘管該應用程序在桌面版本上運行良好。Android模擬器沒有啓動LibGDX項目?
我有最新的nightly版本,ADT版本18,最新的GWT和Eclipse的最新版本。我的Android SDK工具是19版的,而我的Android SDK平臺的工具是版本11
關於如何解決此問題的任何想法?
我正沿着這個教程如下:LibGDX tutorial
這裏是我所看到的截圖:
的logcat:
06-10 19:50:44.282: I/Process(1548): Sending signal. PID: 1548 SIG: 9
06-10 19:50:48.022: I/dalvikvm(1566): threadid=3: reacting to signal 3
06-10 19:50:48.152: I/dalvikvm(1566): Wrote stack traces to '/data/anr/traces.txt'
06-10 19:50:48.312: W/dalvikvm(1566): Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lcom/badlogic/gdx/backends/android/AndroidApplication;
06-10 19:50:48.312: W/dalvikvm(1566): Class init failed in newInstance call (Lcom/me/mygdxgame/MainActivity;)
06-10 19:50:48.322: D/AndroidRuntime(1566): Shutting down VM
06-10 19:50:48.332: W/dalvikvm(1566): threadid=1: thread exiting with uncaught exception (group=0xb40d5180)
06-10 19:50:48.392: E/AndroidRuntime(1566): FATAL EXCEPTION: main
06-10 19:50:48.392: E/AndroidRuntime(1566): java.lang.ExceptionInInitializerError
06-10 19:50:48.392: E/AndroidRuntime(1566): at java.lang.Class.newInstanceImpl(Native Method)
06-10 19:50:48.392: E/AndroidRuntime(1566): at java.lang.Class.newInstance(Class.java:1319)
06-10 19:50:48.392: E/AndroidRuntime(1566): at android.app.Instrumentation.newActivity(Instrumentation.java:1023)
06-10 19:50:48.392: E/AndroidRuntime(1566): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1871)
06-10 19:50:48.392: E/AndroidRuntime(1566): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
06-10 19:50:48.392: E/AndroidRuntime(1566): at android.app.ActivityThread.access$600(ActivityThread.java:123)
06-10 19:50:48.392: E/AndroidRuntime(1566): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
06-10 19:50:48.392: E/AndroidRuntime(1566): at android.os.Handler.dispatchMessage(Handler.java:99)
06-10 19:50:48.392: E/AndroidRuntime(1566): at android.os.Looper.loop(Looper.java:137)
06-10 19:50:48.392: E/AndroidRuntime(1566): at android.app.ActivityThread.main(ActivityThread.java:4424)
06-10 19:50:48.392: E/AndroidRuntime(1566): at java.lang.reflect.Method.invokeNative(Native Method)
06-10 19:50:48.392: E/AndroidRuntime(1566): at java.lang.reflect.Method.invoke(Method.java:511)
06-10 19:50:48.392: E/AndroidRuntime(1566): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
06-10 19:50:48.392: E/AndroidRuntime(1566): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
06-10 19:50:48.392: E/AndroidRuntime(1566): at dalvik.system.NativeStart.main(Native Method)
06-10 19:50:48.392: E/AndroidRuntime(1566): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load gdx: findLibrary returned null
06-10 19:50:48.392: E/AndroidRuntime(1566): at java.lang.Runtime.loadLibrary(Runtime.java:365)
06-10 19:50:48.392: E/AndroidRuntime(1566): at java.lang.System.loadLibrary(System.java:535)
06-10 19:50:48.392: E/AndroidRuntime(1566): at com.badlogic.gdx.utils.GdxNativesLoader.load(GdxNativesLoader.java:116)
06-10 19:50:48.392: E/AndroidRuntime(1566): at com.badlogic.gdx.backends.android.AndroidApplication.<clinit>(AndroidApplication.java:59)
06-10 19:50:48.392: E/AndroidRuntime(1566): ... 15 more
06-10 19:50:49.152: I/dalvikvm(1566): threadid=3: reacting to signal 3
06-10 19:50:49.192: I/dalvikvm(1566): Wrote stack traces to '/data/anr/traces.txt'
06-10 19:50:49.972: I/dalvikvm(1566): threadid=3: reacting to signal 3
06-10 19:50:50.012: I/dalvikvm(1566): Wrote stack traces to '/data/anr/traces.txt'
06-10 19:50:52.093: I/dalvikvm(1566): threadid=3: reacting to signal 3
06-10 19:50:52.112: I/dalvikvm(1566): Wrote stack traces to '/data/anr/traces.txt'
嗯,我當時正在使用Intel Atom(x86)... – BigBug
只需注意x86現在支持,因爲Mario在本文中顯示: http://www.badlogicgames.com/wordpress/?p=3103 「要使用x86本機,只需將x86 /文件夾從nightlies複製到您的Android項目的libs /文件夾(在armeabi和armeabi- v7a文件夾)。setup-ui不會自動爲你添加這些庫。我選擇這樣做,因爲x86安卓設備是非常罕見的,你只是不必要地擴大了APK的大小。 「 – sam