Errors when running application on my Android tablet

Hi there,



I have recently been trying out this engine and have been really impressed with it. Unfortunately I get an error when running my test app on my Nextbook 7" tablet running Android 4.0.3



My error comes from introducing lighting into the scene. I’m guessing my devices graphics driver has an issue with running the lighting shader which I don’t understand as I have run other openGL 2.0 apps/engines using lighting and they have worked perfectly.



Has anyone experienced this problem? I’m having a hard time understanding the error “Not expected token(’&&’)”. Is this error happening while compiling the shader or is it during execution of the shader? I don’t have enough knowledge to work this one out on my own.



The error log reads:


    D/gralloc ( 68): free_buffer: Freeing 0x152000 bytes, mIonFd=22 SharedFd=29
    D/gralloc ( 68): unmap_buffer: Successfully unmapped 0x152000 bytes at address 0x4644f000, SharedFd=29, map_count = 7
    W/dalvikvm( 3714): threadid=12: thread exiting with uncaught exception (group=0x40a661f8)
    E/AndroidHarness( 3714): Exception thrown in Thread[GLThread 406,5,main]
    E/AndroidHarness( 3714): com.jme3.renderer.RendererException: compile error in:ShaderSource[name=Common/MatDefs/Light/Lighting.frag, defines, type=Fragment] error:(37:0) : error : Not expected token('&&') in expression.
    E/AndroidHarness( 3714): (149:0) : error : Not expected token('&&') in expression.
    E/AndroidHarness( 3714): (253:0) : error : Not expected token('&&') in expression.
    E/AndroidHarness( 3714):
    E/AndroidHarness( 3714): at com.jme3.renderer.android.OGLESShaderRenderer.updateShaderSourceData(OGLESShaderRenderer.java:1056)
    E/AndroidHarness( 3714): at com.jme3.renderer.android.OGLESShaderRenderer.updateShaderData(OGLESShaderRenderer.java:1101)
    E/AndroidHarness( 3714): at com.jme3.renderer.android.OGLESShaderRenderer.setShader(OGLESShaderRenderer.java:1206)
    E/AndroidHarness( 3714): at com.jme3.material.Material.renderMultipassLighting(Material.java:862)
    E/AndroidHarness( 3714): at com.jme3.material.Material.render(Material.java:1091)
    E/AndroidHarness( 3714): at com.jme3.renderer.RenderManager.renderGeometry(RenderManager.java:658)
    E/AndroidHarness( 3714): at com.jme3.renderer.queue.RenderQueue.renderGeometryList(RenderQueue.java:301)
    E/AndroidHarness( 3714): at com.jme3.renderer.queue.RenderQueue.renderQueue(RenderQueue.java:353)
    E/AndroidHarness( 3714): at com.jme3.renderer.RenderManager.renderViewPortQueues(RenderManager.java:894)
    E/AndroidHarness( 3714): at com.jme3.renderer.RenderManager.flushQueue(RenderManager.java:850)
    E/AndroidHarness( 3714): at com.jme3.renderer.RenderManager.renderViewPort(RenderManager.java:1126)
    E/AndroidHarness( 3714): at com.jme3.renderer.RenderManager.render(RenderManager.java:1168)
    E/AndroidHarness( 3714): at com.jme3.app.SimpleApplication.update(SimpleApplication.java:254)
    E/AndroidHarness( 3714): at com.jme3.app.AndroidHarness.update(AndroidHarness.java:430)
    E/AndroidHarness( 3714): at com.jme3.system.android.OGLESContext.onDrawFrame(OGLESContext.java:367)
    E/AndroidHarness( 3714): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1462)
    E/AndroidHarness( 3714): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1216)


My apps code is just basically loading an .obj model and introducing a light into the scene. I have used the code from the example TestMonkeyHead.

[java]viewPort.setBackgroundColor(ColorRGBA.DarkGray);

Spatial build1 = (Spatial) assetManager.loadModel("Models/build1/buildingtest.j3o");
build1.scale(0.01f, 0.01f, 0.01f);
//ninja.rotate(0.0f, -3.0f, 0.0f);
build1.setLocalTranslation(-3.5f, -7.0f, 0.0f);

rootNode.attachChild(build1);

lightMdl = new Geometry("Light", new Sphere(10, 10, 0.1f));
lightMdl.setMaterial(assetManager.loadMaterial("Common/Materials/RedColor.j3m"));
rootNode.attachChild(lightMdl);

// flourescent main light
pl = new PointLight();
pl.setColor(new ColorRGBA(0.88f, 0.92f, 0.95f, 1.0f));
rootNode.addLight(pl);[/java]

Upon removing the point light the application runs fine and I can see the onscreen debug info and the sphere geometry.

I'm really hoping I can get this fixed, so any help would be greatly appreciated.

Cheers,
Josh