2014-04-22 122 views
2

我想在Android上運行libgdx遊戲,但它不工作。我可以毫無問題地運行桌面項目,但是當我嘗試運行android之一時,應用程序崩潰。在Android上運行libgdx應用程序時出現異常

我正在使用Intellij IDEA,Debian Sid 64位並使用Nexus 4部署應用程序(它在使用仿真器時也會崩潰)。

我的同事可以運行應用程序沒有問題。他使用Windows 7 64位Eclipse ADT並在Xperia ZQ上運行應用程序。

我試圖按照下面的答案提出的建議,但他們沒有爲我工作,所以任何幫助,將不勝感激。

Trying to run Android game using libgdx on Genymotion

Couldn't load shared library 'gdx' for target

堆棧跟蹤:

04-22 16:11:17.261 9615-9615/? E/AndroidRuntime﹕ FATAL EXCEPTION: main 
    Process: com.sofq.candies, PID: 9615 
    java.lang.ExceptionInInitializerError 
      at java.lang.Class.newInstanceImpl(Native Method) 
      at java.lang.Class.newInstance(Class.java:1208) 
      at android.app.Instrumentation.newActivity(Instrumentation.java:1061) 
      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2112) 
      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245) 
      at android.app.ActivityThread.access$800(ActivityThread.java:135) 
      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196) 
      at android.os.Handler.dispatchMessage(Handler.java:102) 
      at android.os.Looper.loop(Looper.java:136) 
      at android.app.ActivityThread.main(ActivityThread.java:5017) 
      at java.lang.reflect.Method.invokeNative(Native Method) 
      at java.lang.reflect.Method.invoke(Method.java:515) 
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) 
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) 
      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:104) 
      at com.badlogic.gdx.utils.GdxNativesLoader.load(GdxNativesLoader.java:34) 
      at com.badlogic.gdx.backends.android.AndroidApplication.<clinit>(AndroidApplication.java:61) 
            at java.lang.Class.newInstanceImpl(Native Method) 
            at java.lang.Class.newInstance(Class.java:1208) 
            at android.app.Instrumentation.newActivity(Instrumentation.java:1061) 
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2112) 
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245) 
            at android.app.ActivityThread.access$800(ActivityThread.java:135) 
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196) 
            at android.os.Handler.dispatchMessage(Handler.java:102) 
            at android.os.Looper.loop(Looper.java:136) 
            at android.app.ActivityThread.main(ActivityThread.java:5017) 
            at java.lang.reflect.Method.invokeNative(Native Method) 
            at java.lang.reflect.Method.invoke(Method.java:515) 
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) 
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) 
            at dalvik.system.NativeStart.main(Native Method) 
    Caused by: java.lang.UnsatisfiedLinkError: Couldn't load gdx from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.mypackage.myapp-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.mypackage.myapp-2, /vendor/lib, /system/lib]]]: findLibrary returned null 
      at java.lang.Runtime.loadLibrary(Runtime.java:358) 
      at java.lang.System.loadLibrary(System.java:526) 
      at com.badlogic.gdx.utils.SharedLibraryLoader.load(SharedLibraryLoader.java:100) 
            at com.badlogic.gdx.utils.GdxNativesLoader.load(GdxNativesLoader.java:34) 
            at com.badlogic.gdx.backends.android.AndroidApplication.<clinit>(AndroidApplication.java:61) 
            at java.lang.Class.newInstanceImpl(Native Method) 
            at java.lang.Class.newInstance(Class.java:1208) 
            at android.app.Instrumentation.newActivity(Instrumentation.java:1061) 
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2112) 
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245) 
            at android.app.ActivityThread.access$800(ActivityThread.java:135) 
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196) 
            at android.os.Handler.dispatchMessage(Handler.java:102) 
            at android.os.Looper.loop(Looper.java:136) 
            at android.app.ActivityThread.main(ActivityThread.java:5017) 
            at java.lang.reflect.Method.invokeNative(Native Method) 
            at java.lang.reflect.Method.invoke(Method.java:515) 
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) 
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) 
            at dalvik.system.NativeStart.main(Native Method) 

回答

0

爲此都面臨着同樣的錯誤的人,我通過下載基於libgdx搖籃安裝應用程序,下載所有需要解決的問題依賴。

http://libgdx.badlogicgames.com/download.html

+0

我通過更新的Android搖籃插件項目是使用固定它的IntelliJ IDEA。 –

相關問題