2

in past i worked with my projects and everything was good. but recently, i have this errors:

06-02 04:52:27.954: W/dalvikvm(344): Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lcom/badlogic/gdx/backends/android/AndroidApplication;
06-02 04:52:27.954: W/dalvikvm(344): Class init failed in newInstance call (Lcom/Jumper/ProjectAndroidActivity;)
06-02 04:52:27.963: D/AndroidRuntime(344): Shutting down VM
06-02 04:52:27.963: W/dalvikvm(344): threadid=1: thread exiting with uncaught exception (group=0x40015560)
06-02 04:52:27.993: E/AndroidRuntime(344): FATAL EXCEPTION: main
06-02 04:52:27.993: E/AndroidRuntime(344): java.lang.ExceptionInInitializerError
06-02 04:52:27.993: E/AndroidRuntime(344):  at java.lang.Class.newInstanceImpl(Native Method)
06-02 04:52:27.993: E/AndroidRuntime(344):  at java.lang.Class.newInstance(Class.java:1409)
06-02 04:52:27.993: E/AndroidRuntime(344):  at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
06-02 04:52:27.993: E/AndroidRuntime(344):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1561)
06-02 04:52:27.993: E/AndroidRuntime(344):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
06-02 04:52:27.993: E/AndroidRuntime(344):  at android.app.ActivityThread.access$1500(ActivityThread.java:117)
06-02 04:52:27.993: E/AndroidRuntime(344):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
06-02 04:52:27.993: E/AndroidRuntime(344):  at android.os.Handler.dispatchMessage(Handler.java:99)
06-02 04:52:27.993: E/AndroidRuntime(344):  at android.os.Looper.loop(Looper.java:123)
06-02 04:52:27.993: E/AndroidRuntime(344):  at android.app.ActivityThread.main(ActivityThread.java:3683)
06-02 04:52:27.993: E/AndroidRuntime(344):  at java.lang.reflect.Method.invokeNative(Native Method)
06-02 04:52:27.993: E/AndroidRuntime(344):  at java.lang.reflect.Method.invoke(Method.java:507)
06-02 04:52:27.993: E/AndroidRuntime(344):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
06-02 04:52:27.993: E/AndroidRuntime(344):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
06-02 04:52:27.993: E/AndroidRuntime(344):  at dalvik.system.NativeStart.main(Native Method)
06-02 04:52:27.993: E/AndroidRuntime(344): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load gdx: findLibrary returned null
06-02 04:52:27.993: E/AndroidRuntime(344):  at java.lang.Runtime.loadLibrary(Runtime.java:429)
06-02 04:52:27.993: E/AndroidRuntime(344):  at java.lang.System.loadLibrary(System.java:554)
06-02 04:52:27.993: E/AndroidRuntime(344):  at com.badlogic.gdx.utils.GdxNativesLoader.load(GdxNativesLoader.java:116)
06-02 04:52:27.993: E/AndroidRuntime(344):  at com.badlogic.gdx.backends.android.AndroidApplication.<clinit>(AndroidApplication.java:59)
06-02 04:52:27.993: E/AndroidRuntime(344):  ... 15 more

i think this errors are from my libs. but i change them with new ones. is there any solution for it?

4

3 回答 3

10

This error occurs when the armeabi and armeabi-v7a directories cannot be found. Copy both of these directories and their contents into the libs directory of your project.

It should look something like this:

What the libs directory should look like

于 2012-06-02T18:50:42.080 回答
8

you copied the wrong .so files in the folders. I assume you extracted them from gdx-natives.jar. Instead directly copy the armeabi and armeabi-v7a folders from the release/nightly. Make sure to use jars and natives only from a single release, do not mix jars and natives from multiple releases.

Alternatively use the gdx-setup-ui, as described here http://code.google.com/p/libgdx/wiki/ProjectSetupNew

于 2012-06-10T16:33:38.813 回答
4

I got that same error on my VM and other emulators, and found it was because they ran x86 O/S'es, which libgdx does not support.

If it doesn't work on the device either, try this: android-project -> properties -> java Build Path -> Order and Export. Click the project you've linked to (your plain java-project or desktop-project) and click the "Up"-button until it is at the very top. Make sure it's ticked [V]. I did that with the jars too, just in case, and now it runs on my device. I still get that same error on my x86 VM, because libgdx does not support x86 Android devices.

于 2012-10-12T13:46:03.190 回答