NPE in OGLESShaderRenderer after Platform update

After I updated the platform today, my app that was running before the update got the following NPE:



01-16 12:01:15.656 23831 23926 E AndroidHarness: java.lang.NumberFormatException: OpenGL ES GLSL ES 1.00

01-16 12:01:15.656 23831 23926 E AndroidHarness: SEVERE AndroidHarness 12:01:15 PM Exception thrown in Thread[GLThread 12,5,main]: at org.apache.harmony.luni.util.FloatingPointParser.initialParse(130)

01-16 12:01:15.656 23831 23926 E AndroidHarness: at org.apache.harmony.luni.util.FloatingPointParser.parseFloat(319)

01-16 12:01:15.656 23831 23926 E AndroidHarness: at java.lang.Float.parseFloat(323)

01-16 12:01:15.656 23831 23926 E AndroidHarness: at com.jme3.renderer.android.OGLESShaderRenderer.initialize(169)

01-16 12:01:15.656 23831 23926 E AndroidHarness: at com.jme3.system.android.OGLESContext.initInThread(259)

01-16 12:01:15.656 23831 23926 E AndroidHarness: at com.jme3.system.android.OGLESContext.onSurfaceCreated(211)

01-16 12:01:15.656 23831 23926 E AndroidHarness: at android.opengl.GLSurfaceView$GLThread.guardedRun(1348)

01-16 12:01:15.656 23831 23926 E AndroidHarness: at android.opengl.GLSurfaceView$GLThread.run(1118)



I’m running Android 2.3.4



Full Log is:

01-16 12:01:15.414 23831 23831 I OGLESContext: Display EGL Version: 1.0

01-16 12:01:15.414 23831 23831 I AndroidConfigChooser: JME3 using best EGL configuration available here:

01-16 12:01:15.414 23831 23831 I AndroidConfigChooser: JME3 using choosen config:

01-16 12:01:15.414 23831 23831 I AndroidConfigChooser: EGL_RED_SIZE = 8

01-16 12:01:15.414 23831 23831 I AndroidConfigChooser: EGL_GREEN_SIZE = 8

01-16 12:01:15.414 23831 23831 I AndroidConfigChooser: EGL_BLUE_SIZE = 8

01-16 12:01:15.414 23831 23831 I AndroidConfigChooser: EGL_ALPHA_SIZE = 8

01-16 12:01:15.414 23831 23831 I AndroidConfigChooser: EGL_DEPTH_SIZE = 24

01-16 12:01:15.414 23831 23831 I AndroidConfigChooser: EGL_STENCIL_SIZE = 8

01-16 12:01:15.414 23831 23831 I AndroidConfigChooser: EGL_RENDERABLE_TYPE = 4

01-16 12:01:15.414 23831 23831 I AndroidConfigChooser: EGL_SURFACE_TYPE = 5

01-16 12:01:15.445 23831 23831 I AndroidHarness: INFO AndroidHarness 12:01:15 PM Settings: Width 960 Height 540

01-16 12:01:15.453 23831 23831 I AndroidHarness: onStart

01-16 12:01:15.453 23831 23831 I AndroidHarness: onResume

01-16 12:01:15.531 23831 23926 I AndroidConfigChooser: GLSurfaceView asks for egl config, returning:

01-16 12:01:15.546 23831 23926 I AndroidConfigChooser: EGL_RED_SIZE = 8

01-16 12:01:15.546 23831 23926 I AndroidConfigChooser: EGL_GREEN_SIZE = 8

01-16 12:01:15.546 23831 23926 I AndroidConfigChooser: EGL_BLUE_SIZE = 8

01-16 12:01:15.546 23831 23926 I AndroidConfigChooser: EGL_ALPHA_SIZE = 8

01-16 12:01:15.546 23831 23926 I AndroidConfigChooser: EGL_DEPTH_SIZE = 24

01-16 12:01:15.546 23831 23926 I AndroidConfigChooser: EGL_STENCIL_SIZE = 8

01-16 12:01:15.546 23831 23926 I AndroidConfigChooser: EGL_RENDERABLE_TYPE = 4

01-16 12:01:15.546 23831 23926 I AndroidConfigChooser: EGL_SURFACE_TYPE = 5

01-16 12:01:15.546 23831 23926 W IMGSRV : eglglue.c:777: InitContext: ignoring buffer type CBUF_TYPE_PDS_VERT_SECONDARY_PREGEN_BUFFER

01-16 12:01:15.570 23831 23926 I OGLESContext: GL Surface created, doing JME3 init

01-16 12:01:15.570 23831 23926 I OGLESContext: OGLESContext create

01-16 12:01:15.570 23831 23926 I OGLESContext: Running on thread: GLThread 12

01-16 12:01:15.570 23831 23926 I OGLESShaderRenderer: INFO OGLESShaderRenderer 12:01:15 PM use_VBO [false] → [false]

01-16 12:01:15.570 23831 23926 I OGLESShaderRenderer: INFO OGLESShaderRenderer 12:01:15 PM verboseLogging [false] → [false]

01-16 12:01:15.570 23831 23926 I OGLESShaderRenderer: INFO OGLESShaderRenderer 12:01:15 PM Vendor: Imagination Technologies

01-16 12:01:15.593 23831 23926 I OGLESShaderRenderer: INFO OGLESShaderRenderer 12:01:15 PM Renderer: PowerVR SGX 540

01-16 12:01:15.593 23831 23926 I OGLESShaderRenderer: INFO OGLESShaderRenderer 12:01:15 PM Version: OpenGL ES 2.0

01-16 12:01:15.593 23831 23926 I OGLESShaderRenderer: INFO OGLESShaderRenderer 12:01:15 PM GLES20.Shading Language Version: OpenGL ES GLSL ES 1.00

01-16 12:01:15.656 23831 23926 W dalvikvm: threadid=9: thread exiting with uncaught exception (group=0x4001e560)

01-16 12:01:15.656 23831 23926 E AndroidHarness: java.lang.NumberFormatException: OpenGL ES GLSL ES 1.00

01-16 12:01:15.656 23831 23926 E AndroidHarness: SEVERE AndroidHarness 12:01:15 PM Exception thrown in Thread[GLThread 12,5,main]: at org.apache.harmony.luni.util.FloatingPointParser.initialParse(130)

01-16 12:01:15.656 23831 23926 E AndroidHarness: at org.apache.harmony.luni.util.FloatingPointParser.parseFloat(319)

01-16 12:01:15.656 23831 23926 E AndroidHarness: at java.lang.Float.parseFloat(323)

01-16 12:01:15.656 23831 23926 E AndroidHarness: at com.jme3.renderer.android.OGLESShaderRenderer.initialize(169)

01-16 12:01:15.656 23831 23926 E AndroidHarness: at com.jme3.system.android.OGLESContext.initInThread(259)

01-16 12:01:15.656 23831 23926 E AndroidHarness: at com.jme3.system.android.OGLESContext.onSurfaceCreated(211)

01-16 12:01:15.656 23831 23926 E AndroidHarness: at android.opengl.GLSurfaceView$GLThread.guardedRun(1348)

01-16 12:01:15.656 23831 23926 E AndroidHarness: at android.opengl.GLSurfaceView$GLThread.run(1118)

Heh, I guess it will work on Android 4.0, @Momoko_Fan added a fix to parse the version for that :wink: We’ll push another update when this is fixed.

Yeah. My guess was that the fix for Android 4 broke Android 2 :slight_smile:



I also had to redefine a couple of global libraries to point to new JAR files. Was the update supposed to make those changes automatically or is it supposed to be a manual change?



library jme3 needed to be changed to jME3-core and library jme3-android needed to be changed to jME3-Android

Uh no, the libraries should be referencing the new jar files, unless you chose to copy them to the project folder in the projects settings in which case they cannot be updated. Also, you do not need to add jme3-android to your applications at all, also not if you want to deploy to android.

Sorry if I wasn’t clear. I don’t add any project specific libraries. After I updated the platform, I received some errors about unresolved jar files. When I went to Tools->Libraries, the jme3 library was still pointing to jMonkeyEngine3.jar (which didn’t exist anymore) and the jme3-android library was still pointing to the original android jar file (can’t remember the name). I manually changed the libraries in the Tools->Libraries menu and all was fine.



I have changed these manually in the past to point to my locally built engine and the then changed it back to the default settings, so maybe that stopped the update from making the changes? Not sure. Could be my fault.

The descriptor that points to them comes with the plugin that contains the jar files but if you changed them manually then it will not be used. Theres a file in a folder (sorry for not being more specific) inside your settings folder that contains this info. If you delete it you get back to default behavior. In any case rather add a new library instead of re-referencing the ones that come with the SDK or any plugin.

Ah, this was the thread. Try this:



Rename “%USERHOME%\appdata\Roaming\.jmonkeyplatform”

to “%USERHOME%\appdata\Roaming\.jmonkeyplatform"



Start jMP and let it create a new folder.



Copy “%USERHOME%\appdata\Roaming\.jmonkeyplatform\3.0beta\build.properties”

to "%USERHOME%\appdata\Roaming\
.jmonkeyplatform\3.0beta\build.properties”



Delete “%USERHOME%\appdata\Roaming\.jmonkeyplatform”



Rename “%USERHOME%\appdata\Roaming\_.jmonkeyplatform”

to “%USERHOME%\appdata\Roaming\.jmonkeyplatform”

I tried the lastest change to OGLESShaderRenderer and I’m not crashing anymore.