Android Emulator 不启动 LibGDX 项目? [英] Android Emulator does not launch LibGDX project?

查看:28
本文介绍了Android Emulator 不启动 LibGDX 项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Whenever i try to execute the application on the emulator, the emulator displays an error saying "Unfortunately, My libGDX Game has stopped." The application runs fine in the desktop version though.

I have the latest nightly version, ADT version 18, latest GWT, and latest version of eclipse. My Android SDK tools is version 19, while my android SDK platform-tools is version 11.

Any ideas on how to fix this?

I was following along this tutorial: LibGDX tutorial

Here is a screenshot of what i see:

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'

解决方案

If this is an ARM based emulator, you forgot to add the armeabi and armeabi-v7a folders to your Android project's libs/ folder. Please follow the setup guide here: http://code.google.com/p/libgdx/wiki/ProjectSetupNew

I̶f̶ ̶t̶h̶i̶s̶ ̶i̶s̶ ̶a̶n̶ ̶x̶8̶6̶ ̶b̶a̶s̶e̶d̶ ̶e̶m̶u̶l̶a̶t̶o̶r̶,̶ ̶t̶h̶e̶n̶ ̶i̶'̶m̶ ̶a̶f̶r̶a̶i̶d̶ ̶t̶h̶e̶r̶e̶'̶s̶ ̶n̶o̶ ̶s̶o̶l̶u̶t̶i̶o̶n̶ ̶f̶o̶r̶ ̶t̶h̶i̶s̶ ̶i̶s̶s̶u̶e̶ ̶y̶e̶t̶.̶ ̶W̶e̶ ̶d̶o̶ ̶n̶o̶t̶ ̶c̶o̶m̶p̶i̶l̶e̶ ̶f̶o̶r̶ ̶A̶n̶d̶r̶o̶i̶d̶ ̶x̶8̶6̶ ̶a̶t̶ ̶t̶h̶e̶ ̶m̶o̶m̶e̶n̶t̶.̶

Edit.- x86 is now supported

这篇关于Android Emulator 不启动 LibGDX 项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆