试图在Genymotion上使用libgdx运行Android游戏

时间:2013-08-31 15:42:46

标签: android libgdx genymotion

有没有经历过libgdx和genymotion的人?

我正试图在genymotion android模拟器上运行一个libgdx游戏 - http://www.genymotion.com/

每当我尝试在genymotion上运行时,我都会遇到以下异常:

java.lang.ExceptionInInitializerError
    at java.lang.Class.newInstanceImpl(Native Method)
    at java.lang.Class.newInstance(Class.java:1319)
    at android.app.Instrumentation.newActivity(Instrumentation.java:1053)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1974)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
    at android.app.ActivityThread.access$600(ActivityThread.java:130)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:137)
    at android.app.ActivityThread.main(ActivityThread.java:4745)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
    at dalvik.system.NativeStart.main(Native Method)
 Caused by: com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load shared library 'gdx' for target: Linux, 32-bit
    at com.badlogic.gdx.utils.SharedLibraryLoader.load(SharedLibraryLoader.java:113)
    at com.badlogic.gdx.utils.GdxNativesLoader.load(GdxNativesLoader.java:34)
    at com.badlogic.gdx.backends.android.AndroidApplication.<clinit>(AndroidApplication.java:61)
    ... 15 more
 Caused by: java.lang.UnsatisfiedLinkError: Couldn't load gdx: findLibrary returned null
    at java.lang.Runtime.loadLibrary(Runtime.java:365)
    at java.lang.System.loadLibrary(System.java:535)
    at com.badlogic.gdx.utils.SharedLibraryLoader.load(SharedLibraryLoader.java:109)
    ... 17 more

任何想法?

适用于AVD

Android API 16 libgdx 0.9.9 Genymotion 1.1.0

1 个答案:

答案 0 :(得分:5)

您应该尝试将x86本机库添加到libs文件夹中,如this post中所述

  

要使用x86本机,只需将x86 /文件夹从nightlies复制到Android项目的libs /文件夹(armeabi和armeabi-v7a文件夹旁边)。 setup-ui不会自动为您添加这些库。我暂时选择这样做,因为x86 Android设备非常罕见,而且你只是不必要地炸掉你的APK大小。