Test jme3 in android project fails to build

os:win7 64 bit ide: myeclipse and jmp

android 3.2 /3.1

lib contains :

engine/dist/opt/android/jMonkeyEngine3.jar

engine/dist/lib/eventbus-1.4.jar

engine/dist/lib/jbullet.jar

engine/dist/lib/jheora-jst-debug-0.6.0.jar

engine/dist/lib/jinput.jar

engine/dist/lib/jME3-jbullet.jar

engine/dist/lib/jME3-lwjgl-natives.jar

engine/dist/lib/jME3-test.jar

engine/dist/lib/jME3-testdata.jar

engine/dist/lib/j-ogg-oggd.jar

engine/dist/lib/j-ogg-vorbisd.jar

engine/dist/lib/lwjgl.jar

engine/dist/lib/nifty-1.3.jar

engine/dist/lib/nifty-default-controls-1.3.jar

engine/dist/lib/nifty-examples-1.3.jar

engine/dist/lib/nifty-lwjgl-renderer-1.3.jar

engine/dist/lib/nifty-openal-soundsystem-1.0.jar

engine/dist/lib/nifty-style-black-1.3.jar

engine/dist/lib/nifty-style-grey-1.0.jar

engine/dist/lib/noise-0.0.1-SNAPSHOT.jar

engine/dist/lib/stack-alloc.jar

engine/dist/lib/vecmath.jar

engine/dist/lib/xmlpull-xpp3-1.1.4c.jar

console info:

[2011-07-20 20:39:43 - jmeandroidtest] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class

(org.xmlpull.v1.builder.impl.XmlElementImpl$3) that doesn’t come with an

associated EnclosingMethod attribute. This class was probably produced by a

compiler that did not target the modern .class file format. The recommended

solution is to recompile the class from source, using an up-to-date compiler

and without specifying any “-target” type options. The consequence of ignoring

this warning is that reflective operations on this class will incorrectly

indicate that it is not an inner class.

[2011-07-20 20:39:54 - jmeandroidtest] The library ‘jME3-lwjgl-natives.jar’ contains native libraries that will not run on the device.

[2011-07-20 20:39:54 - jmeandroidtest] The following libraries were found:

[2011-07-20 20:39:54 - jmeandroidtest] – native/linux/libjinput-linux.so

[2011-07-20 20:39:54 - jmeandroidtest] – native/linux/libjinput-linux64.so

[2011-07-20 20:39:54 - jmeandroidtest] – native/linux/liblwjgl.so

[2011-07-20 20:39:54 - jmeandroidtest] – native/linux/liblwjgl64.so

[2011-07-20 20:39:54 - jmeandroidtest] – native/linux/libopenal.so

[2011-07-20 20:39:54 - jmeandroidtest] – native/linux/libopenal64.so

[2011-07-20 20:39:54 - jmeandroidtest] – native/macosx/libjinput-osx.jnilib

[2011-07-20 20:39:54 - jmeandroidtest] – native/macosx/liblwjgl.jnilib

[2011-07-20 20:39:54 - jmeandroidtest] – native/solaris/liblwjgl.so

[2011-07-20 20:39:54 - jmeandroidtest] – native/solaris/liblwjgl64.so

[2011-07-20 20:39:54 - jmeandroidtest] – native/solaris/libopenal.so

[2011-07-20 20:39:54 - jmeandroidtest] – native/solaris/libopenal64.so

I removed the problem of the jar package, new problems have emerged

[2011-07-20 21:06:14 - jmeandroidtest] Error generating final archive: Found duplicate file for APK: console.fnt

Origin 1: E:jme3srcenginedistlibnifty-examples-1.3.jar

Origin 2: E:jme3srcenginedistlibnifty-style-black-1.3.jar

Next,I removed E:jme3srcenginedistlibnifty-examples-1.3.jar,console info:

[2011-07-20 21:10:38 - jmeandroidtest] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class

(org.xmlpull.v1.builder.impl.XmlElementImpl$3) that doesn’t come with an

associated EnclosingMethod attribute. This class was probably produced by a

compiler that did not target the modern .class file format. The recommended

solution is to recompile the class from source, using an up-to-date compiler

and without specifying any “-target” type options. The consequence of ignoring

this warning is that reflective operations on this class will incorrectly

indicate that it is not an inner class.

Seems to build successful,install .apk file , In the simulator, the program runs only a fleeting.Very frustrating, I do not know how to solve the above problems, why, I wasted a long time, but I just want to see in the android’s performance jme3

@yanwang: Hi there. I recently covered this issue in [this forum post]. Please check it for the solution. :slight_smile:

You should only need engine/dist/opt/android/jMonkeyEngine3.jar in your libpath, maybe JME3-test*.jar

And if you need nifty add the nifty jars.



But DON’T include any x86 native jars like lwjgl. There is no lwjgl on android. Also OpenAL will not work as intended :slight_smile:



PS: Did you say you try to run it on the emulator ? 8)

larynx said:
You should only need engine/dist/opt/android/jMonkeyEngine3.jar in your libpath, maybe JME3-test*.jar
And if you need nifty add the nifty jars.
But DON'T include any x86 native jars like lwjgl. There is no lwjgl on android. Also OpenAL will not work as intended :)
PS: Did you say you try to run it on the emulator ? 8)

yes.I run it on the emulator android.
I chose the test class is jme3test.android.SimpleTexturedTest.Do you mean that only need engine/dist/opt/android/jMonkeyEngine3.jar add to the class path?

I do as you say,myeclipse console info:

2011-07-21 20:47:14 - jmeandroidtest]
[2011-07-21 20:47:14 - jmeandroidtest] Android Launch!
[2011-07-21 20:47:14 - jmeandroidtest] adb is running normally.
[2011-07-21 20:47:14 - jmeandroidtest] Performing com.yanwang.GameHarness activity launch
[2011-07-21 20:47:14 - jmeandroidtest] Automatic Target Mode: using existing emulator 'emulator-5554' running compatible AVD 'avd3.2'
[2011-07-21 20:47:14 - jmeandroidtest] Uploading jmeandroidtest.apk onto device 'emulator-5554'
[2011-07-21 20:47:42 - jmeandroidtest] Installing jmeandroidtest.apk...
[2011-07-21 20:47:51 - jmeandroidtest] Success!
[2011-07-21 20:47:51 - jmeandroidtest] Starting activity com.yanwang.GameHarness on device emulator-5554
[2011-07-21 20:47:52 - jmeandroidtest] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.yanwang/.GameHarness }

This is much better than before, but then, I run it on emulator
logcat error info:

07-21 12:54:17.413: ERROR/AndroidConfigChooser(676): ###ERROR### Unable to get a valid OpenGL ES 2.0 config, nether Fastest nor Best found! Bug. Please report this.
07-21 12:54:17.423: ERROR/OGLESContext(676): Unable to find suitable EGL config
07-21 12:54:17.423: ERROR/OGLESContext(676): OpenGL ES 2.0 is not supported on this device
07-21 12:54:17.594: ERROR/SurfaceFlinger(32): createNormalSurfaceLocked() failed (Value too large for defined data type)
07-21 12:54:17.933: ERROR/AndroidRuntime(676): FATAL EXCEPTION: GLThread 10
07-21 12:54:17.933: ERROR/AndroidRuntime(676): java.lang.IllegalArgumentException
07-21 12:54:17.933: ERROR/AndroidRuntime(676): at com.google.android.gles_jni.EGLImpl._eglCreateContext(Native Method)
07-21 12:54:17.933: ERROR/AndroidRuntime(676): at com.google.android.gles_jni.EGLImpl.eglCreateContext(EGLImpl.java:49)
07-21 12:54:17.933: ERROR/AndroidRuntime(676): at android.opengl.GLSurfaceView$DefaultContextFactory.createContext(GLSurfaceView.java:747)
07-21 12:54:17.933: ERROR/AndroidRuntime(676): at android.opengl.GLSurfaceView$EglHelper.start(GLSurfaceView.java:987)
07-21 12:54:17.933: ERROR/AndroidRuntime(676): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1330)
07-21 12:54:17.933: ERROR/AndroidRuntime(676): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1184)
07-21 12:54:17.965: ERROR/SurfaceFlinger(32): createNormalSurfaceLocked() failed (Value too large for defined data type)
07-21 12:54:18.023: ERROR/InputDispatcher(82): channel '4093ee10 com.yanwang/com.yanwang.GameHarness (server)' ~ Consumer closed input channel or an error occurred. events=0x8
07-21 12:54:18.023: ERROR/InputDispatcher(82): channel '4093ee10 com.yanwang/com.yanwang.GameHarness (server)' ~ Channel is unrecoverably broken and will be disposed!

Im very sorry to tell but the ###ERROR### says it very clearly:



There is no OpenGL ES 2.0 support on the emulator. You need a real device to test! (with Android 2.2+)