由libgdx创建的项目不适用于android

时间:2014-04-25 23:00:29

标签: java android android-emulator libgdx adt

我使用最新的libgdx版本(0.9.9)和最新版本的ADT(Build:v22.6.2-1085508)以及SDK Tolls版本22.6.2和SDK平台工具版本19.0.1以及SDK Build版本19.0 0.3。我的程序在桌面上运行正常,但是当我想在android上模拟它时它会给我错误(不幸的是,BirdEscape已经停止)。我的桌面是64位,我在android的根目录中有 armeabi armeabi-v7a 。请看这里: https://www.dropbox.com/s/cdogyhbxj3x8kyh/Capture.PNG

设备的设置是这样的: https://www.dropbox.com/s/ogk7hlv5oeat036/capturesetting.PNG

04-25 18:14:18.383: D/dalvikvm(1198): Trying to load lib /data/app-lib/com.Solijon.BirdEscape.android-1/libgdx.so 0xb3d03bb8
04-25 18:14:18.423: D/dalvikvm(1198): Added shared lib /data/app-lib/com.Solijon.BirdEscape.android-1/libgdx.so 0xb3d03bb8
04-25 18:14:18.423: D/dalvikvm(1198): No JNI_OnLoad found in /data/app-lib/com.Solijon.BirdEscape.android-1/libgdx.so 0xb3d03bb8, skipping init
04-25 18:14:18.503: D/AndroidRuntime(1198): Shutting down VM
04-25 18:14:18.503: W/dalvikvm(1198): threadid=1: thread exiting with uncaught exception (group=0xb3a3fba8)
04-25 18:14:18.523: E/AndroidRuntime(1198): FATAL EXCEPTION: main
04-25 18:14:18.523: E/AndroidRuntime(1198): Process: com.Solijon.BirdEscape.android, PID: 1198
04-25 18:14:18.523: E/AndroidRuntime(1198): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.Solijon.BirdEscape.android/com.Solijon.BirdEscape.android.AndroidLauncher}: com.badlogic.gdx.utils.GdxRuntimeException: Libgdx requires OpenGL ES 2.0
04-25 18:14:18.523: E/AndroidRuntime(1198):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
04-25 18:14:18.523: E/AndroidRuntime(1198):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
04-25 18:14:18.523: E/AndroidRuntime(1198):     at android.app.ActivityThread.access$800(ActivityThread.java:135)
04-25 18:14:18.523: E/AndroidRuntime(1198):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
04-25 18:14:18.523: E/AndroidRuntime(1198):     at android.os.Handler.dispatchMessage(Handler.java:102)
04-25 18:14:18.523: E/AndroidRuntime(1198):     at android.os.Looper.loop(Looper.java:136)
04-25 18:14:18.523: E/AndroidRuntime(1198):     at android.app.ActivityThread.main(ActivityThread.java:5017)
04-25 18:14:18.523: E/AndroidRuntime(1198):     at java.lang.reflect.Method.invokeNative(Native Method)
04-25 18:14:18.523: E/AndroidRuntime(1198):     at java.lang.reflect.Method.invoke(Method.java:515)
04-25 18:14:18.523: E/AndroidRuntime(1198):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
04-25 18:14:18.523: E/AndroidRuntime(1198):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
04-25 18:14:18.523: E/AndroidRuntime(1198):     at dalvik.system.NativeStart.main(Native Method)
04-25 18:14:18.523: E/AndroidRuntime(1198): Caused by: com.badlogic.gdx.utils.GdxRuntimeException: Libgdx requires OpenGL ES 2.0
04-25 18:14:18.523: E/AndroidRuntime(1198):     at com.badlogic.gdx.backends.android.AndroidGraphics.createGLSurfaceView(AndroidGraphics.java:121)
04-25 18:14:18.523: E/AndroidRuntime(1198):     at com.badlogic.gdx.backends.android.AndroidGraphics.<init>(AndroidGraphics.java:101)
04-25 18:14:18.523: E/AndroidRuntime(1198):     at com.badlogic.gdx.backends.android.AndroidGraphics.<init>(AndroidGraphics.java:94)
04-25 18:14:18.523: E/AndroidRuntime(1198):     at com.badlogic.gdx.backends.android.AndroidApplication.init(AndroidApplication.java:130)
04-25 18:14:18.523: E/AndroidRuntime(1198):     at com.badlogic.gdx.backends.android.AndroidApplication.initialize(AndroidApplication.java:96)
04-25 18:14:18.523: E/AndroidRuntime(1198):     at com.Solijon.BirdEscape.android.AndroidLauncher.onCreate(AndroidLauncher.java:14)
04-25 18:14:18.523: E/AndroidRuntime(1198):     at android.app.Activity.performCreate(Activity.java:5231)
04-25 18:14:18.523: E/AndroidRuntime(1198):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
04-25 18:14:18.523: E/AndroidRuntime(1198):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
04-25 18:14:18.523: E/AndroidRuntime(1198):     ... 11 more

1 个答案:

答案 0 :(得分:2)

基本上LibGDX是错误的,因为模拟器不允许它使用GLES 2.要在模拟器上启用它,您需要勾选其设置中的“使用主机GPU”框。