Library is missing at runtime

I’m trying to compile a jME game using the SDK into an Android app, but it always crashes on start.

The error is:
[spoiler]E/com.jme3.app.AndroidHarness( 5743): SEVERE Class com.gameminers.hydricon.jme.HydriconJME init failed
E/com.jme3.app.AndroidHarness( 5743): java.lang.ClassNotFoundException: com.gameminers.hydricon.jme.HydriconJME
E/com.jme3.app.AndroidHarness( 5743): at java.lang.Class.classForName(Native Method)
E/com.jme3.app.AndroidHarness( 5743): at java.lang.Class.forName(Class.java:251)
E/com.jme3.app.AndroidHarness( 5743): at java.lang.Class.forName(Class.java:216)
E/com.jme3.app.AndroidHarness( 5743): at com.jme3.app.AndroidHarness.onCreate(AndroidHarness.java:223)
E/com.jme3.app.AndroidHarness( 5743): at android.app.Activity.performCreate(Activity.java:5231)
E/com.jme3.app.AndroidHarness( 5743): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
E/com.jme3.app.AndroidHarness( 5743): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2169)
E/com.jme3.app.AndroidHarness( 5743): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2264)
E/com.jme3.app.AndroidHarness( 5743): at android.app.ActivityThread.access$800(ActivityThread.java:144)
E/com.jme3.app.AndroidHarness( 5743): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1205)
E/com.jme3.app.AndroidHarness( 5743): at android.os.Handler.dispatchMessage(Handler.java:102)
E/com.jme3.app.AndroidHarness( 5743): at android.os.Looper.loop(Looper.java:136)
E/com.jme3.app.AndroidHarness( 5743): at android.app.ActivityThread.main(ActivityThread.java:5139)
E/com.jme3.app.AndroidHarness( 5743): at java.lang.reflect.Method.invokeNative(Native Method)
E/com.jme3.app.AndroidHarness( 5743): at java.lang.reflect.Method.invoke(Method.java:515)
E/com.jme3.app.AndroidHarness( 5743): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:796)
E/com.jme3.app.AndroidHarness( 5743): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:612)
E/com.jme3.app.AndroidHarness( 5743): at dalvik.system.NativeStart.main(Native Method)
E/com.jme3.app.AndroidHarness( 5743): Caused by: java.lang.NoClassDefFoundError: com.gameminers.hydricon.World
E/com.jme3.app.AndroidHarness( 5743): at com.gameminers.hydricon.jme.HydriconJME.<clinit>(HydriconJME.java:90)
E/com.jme3.app.AndroidHarness( 5743): … 18 more[/spoiler]

Above it is also spam of ‘DexOpt: unable to optimize instance field ref’, and near the top is ‘VFY: unable to find class referenced in signature’

I’ve checked the generated classes.dex with dexdump, and the library is in fact missing. The library is being dexed and is in the libraries list in the project, but does not exist in the resulting apk. Compilation completes with no errors, and running the project on the development box works as well.

Please advise, I am at a loss as to what is causing this and have been trying to fix it to no avail for the past day and a half.

Try a clean&build. If that doesn’t work it might be you have to make a change in the .java file in question and save it again, on windows there seems to be an issue with file permissions that make some files “disappear” from the attention of the IDE under certain circumstances.

Still getting the same error, I edited the main Application file by adding a newline then saving it, and unset read-only on all the files in the project. I then ran a clean & build and then debug. I already have full control permissions on all of the files and the main project folder.

EDIT: We get the same issue in Android Studio if we pull in the library and jME; I also checked the dexdump output again, and even jME is missing - it seems no libraries are ending up the apk at all, even ones built-in to the SDK. I have gotten the Android test project to compile and run, so my SDK installation is good… not sure what is going on here.

We’ve solved the problem by pulling the sources for the library into the project instead of using a compiled jar.