Nexus 4 Problem

Hi, I just created basic application in JME SDK 3.0RC2 and tried to run it on my Nexus 4 device. It failed with the following errors (not pasting the whole stack):
/OGLESContext(27326): GL Surface created, doing JME3 init
I/OGLESContext(27326): OGLESContext create
I/OGLESContext(27326): INFO OGLESContext 8:16:08 PM Running on thread: GLThread 2287
W/IInputConnectionWrapper( 768): showStatusIcon on inactive InputConnection
I/ActivityManager( 499): Displayed com.mycompany.mygame/.MainActivity: +349ms
I/OGLESShaderRenderer(27326): INFO OGLESShaderRenderer 8:16:08 PM Vendor: Qualcomm
I/OGLESShaderRenderer(27326): INFO OGLESShaderRenderer 8:16:08 PM Renderer: Adreno ™ 320
I/OGLESShaderRenderer(27326): INFO OGLESShaderRenderer 8:16:08 PM Version: OpenGL ES 2.0 V@6.0 AU@ (CL@2961380)
I/OGLESShaderRenderer(27326): INFO OGLESShaderRenderer 8:16:08 PM Shading Language Version: OpenGL ES GLSL ES 1.00
I/OGLESShaderRenderer(27326): INFO OGLESShaderRenderer 8:16:08 PM VTF Units: 4
I/OGLESShaderRenderer(27326): INFO OGLESShaderRenderer 8:16:08 PM Texture Units: 16
I/OGLESShaderRenderer(27326): INFO OGLESShaderRenderer 8:16:08 PM Vertex Attributes: 16
D/dalvikvm(27326): GC_CONCURRENT freed 264K, 4% free 8770K/9064K, paused 6ms+3ms, total 22ms
I/OGLESShaderRenderer(27326): INFO OGLESShaderRenderer 8:16:08 PM Subpixel Bits: 4
I/OGLESShaderRenderer(27326): INFO OGLESShaderRenderer 8:16:08 PM Maximum Texture Resolution: 4,096
I/OGLESShaderRenderer(27326): INFO OGLESShaderRenderer 8:16:08 PM Maximum CubeMap Resolution: 4,096
I/OGLESShaderRenderer(27326): INFO OGLESShaderRenderer 8:16:08 PM GL_EXTENSIONS: GL_EXT_debug_marker GL_AMD_compressed_ATC_texture GL_AMD_performance_monitor GL_AMD_program_binary_Z400 GL_EXT_robustness GL_EXT_texture_format_BGRA8888 GL_EXT_texture_type_2_10_10_10_REV GL_NV_fence GL_OES_compressed_ETC1_RGB8_texture GL_OES_depth_texture GL_OES_depth24 GL_OES_EGL_image GL_OES_EGL_image_external GL_OES_element_index_uint GL_OES_fbo_render_mipmap GL_OES_fragment_precision_high GL_OES_get_program_binary GL_OES_packed_depth_stencil GL_OES_rgb8_rgba8 GL_OES_standard_derivatives GL_OES_texture_3D GL_OES_texture_float GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_OES_texture_npot GL_OES_vertex_half_float GL_OES_vertex_type_10_10_10_2 GL_OES_vertex_array_object GL_QCOM_alpha_test GL_QCOM_binning_control GL_QCOM_driver_control GL_QCOM_perfmon_global_mode GL_QCOM_extended_get GL_QCOM_extended_get2 GL_QCOM_tiled_rendering GL_QCOM_writeonly_rendering GL_EXT_sRGB
F/libc (27326): Fatal signal 11 (SIGSEGV) at 0x000092e6 (code=1), thread 27353 (Thread-2287)
I/DEBUG (26227): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG (26227): Build fingerprint: ‘google/occam/mako:4.2.2/JDQ39/573038:user/release-keys’
I/DEBUG (26227): Revision: ‘11’
I/DEBUG (26227): pid: 27326, tid: 27353, name: Thread-2287 >>> com.mycompany.mygame <<<
I/DEBUG (26227): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 000092e6

…

I/ActivityManager( 499): Process com.mycompany.mygame (pid 27326) has died.
W/InputDispatcher( 499): channel ‘41a1f538 com.mycompany.mygame/com.mycompany.mygame.MainActivity (server)’ ~ Consumer closed input channel or an error occurred. events=0x9
E/InputDispatcher( 499): channel ‘41a1f538 com.mycompany.mygame/com.mycompany.mygame.MainActivity (server)’ ~ Channel is unrecoverably broken and will be disposed!
W/InputDispatcher( 499): Attempted to unregister already unregistered input channel ‘41a1f538 com.mycompany.mygame/com.mycompany.mygame.MainActivity (server)’
I/WindowState( 499): WIN DEATH: Window{41a1f538 u0 com.mycompany.mygame/com.mycompany.mygame.MainActivity}
W/ActivityManager( 499): Force removing ActivityRecord{4143f260 u0 com.mycompany.mygame/.MainActivity}: app died, no saved state
W/WindowManager( 499): Force-removing child win Window{41a55cd8 u0 SurfaceView} from container Window{41a1f538 u0 com.mycompany.mygame/com.mycompany.mygame.MainActivity}
W/WindowManager( 499): Failed looking up window
W/WindowManager( 499): java.lang.IllegalArgumentException: Requested window android.os.BinderProxy@41556e60 does not exist
W/WindowManager( 499): at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:8102)
W/WindowManager( 499): at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:8093)
W/WindowManager( 499): at com.android.server.wm.WindowState$DeathRecipient.binderDied(WindowState.java:932)
W/WindowManager( 499): at android.os.BinderProxy.sendDeathNotice(Binder.java:433)
W/WindowManager( 499): at dalvik.system.NativeStart.run(Native Method)
I/WindowState( 499): WIN DEATH: null
I/InputReader( 499): Reconfiguring input devices. changes=0x00000004
I/InputReader( 499): Device reconfigured: id=6, name=‘touch_dev’, size 768x1280, orientation 0, mode 1, display id 0
I/ActivityManager( 499): Config changes=1480 {1.0 293mcc40mnc en_US ldltr sw384dp w384dp h567dp 320dpi nrml port finger -keyb/v/h -nav/h s.325}
D/Zygote ( 159): Process 27326 terminated by signal (11)
W/InputMethodManagerService( 499): Got RemoteException sending setActive(false) notification to pid 27326 uid 10083
W/PhoneStatusBar/NavigationBarView( 612): *** Invalid layout in navigation bar (sizeChanged this=768x96 cur=84x768)
D/overlay ( 158): Set pipe=RGB1 dpy=0; Set pipe=VG0 dpy=0; Set pipe=VG1 dpy=0;
D/dalvikvm( 499): GC_EXPLICIT freed 1403K, 22% free 34053K/43616K, paused 12ms+11ms, total 170ms

Anyone has any clue why this wouldn’t work?

Yep that’s a known issue of RC2. I’m afraid that you have no other way than to use the nightly build.

Huh, I cannot access nightly repository?
http://www.jmonkeyengine.org/nightly/

Sorry, you have probably meant through SDK. Still, the link doesn’t work. :wink:
If I put hub instead of www, there is a nightly broken error thread hehe. :slight_smile:

erf…I forgot about that.
@sbook, could you please look into this? I mean the broken link.

Well I have managed to successfully run BasicGame example as well as JME tests.
It bothers me that I cannot prepare my project to run. I configured it in exactly the same way as the BasicGame. I even have the package name the same, although I have a little more subpackages and classes. Any clues on what is wrong? :slight_smile:
Error trace:

E/com.jme3.app.AndroidHarness( 2106): SEVERE Class mygame.Main init failed
E/com.jme3.app.AndroidHarness( 2106): java.lang.ClassNotFoundException: mygame.Main
E/com.jme3.app.AndroidHarness( 2106): at java.lang.Class.classForName(Native Method)
E/com.jme3.app.AndroidHarness( 2106): at java.lang.Class.forName(Class.java:217)
E/com.jme3.app.AndroidHarness( 2106): at java.lang.Class.forName(Class.java:172)
E/com.jme3.app.AndroidHarness( 2106): at com.jme3.app.AndroidHarness.onCreate(AndroidHarness.java:223)
E/com.jme3.app.AndroidHarness( 2106): at android.app.Activity.performCreate(Activity.java:5104)
E/com.jme3.app.AndroidHarness( 2106): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
E/com.jme3.app.AndroidHarness( 2106): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
E/com.jme3.app.AndroidHarness( 2106): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
E/com.jme3.app.AndroidHarness( 2106): at android.app.ActivityThread.access$600(ActivityThread.java:141)
E/com.jme3.app.AndroidHarness( 2106): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
E/com.jme3.app.AndroidHarness( 2106): at android.os.Handler.dispatchMessage(Handler.java:99)
E/com.jme3.app.AndroidHarness( 2106): at android.os.Looper.loop(Looper.java:137)
E/com.jme3.app.AndroidHarness( 2106): at android.app.ActivityThread.main(ActivityThread.java:5041)
E/com.jme3.app.AndroidHarness( 2106): at java.lang.reflect.Method.invokeNative(Native Method)
E/com.jme3.app.AndroidHarness( 2106): at java.lang.reflect.Method.invoke(Method.java:511)
E/com.jme3.app.AndroidHarness( 2106): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
E/com.jme3.app.AndroidHarness( 2106): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
E/com.jme3.app.AndroidHarness( 2106): at dalvik.system.NativeStart.main(Native Method)
E/com.jme3.app.AndroidHarness( 2106): Caused by: java.lang.NoClassDefFoundError: mygame/Main
E/com.jme3.app.AndroidHarness( 2106): … 18 more
E/com.jme3.app.AndroidHarness( 2106): Caused by: java.lang.ClassNotFoundException: Didn’t find class “mygame.Main” on path: /data/app/com.mygame-1.apk
E/com.jme3.app.AndroidHarness( 2106): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65)
E/com.jme3.app.AndroidHarness( 2106): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
E/com.jme3.app.AndroidHarness( 2106): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
E/com.jme3.app.AndroidHarness( 2106): … 18 more
E/com.jme3.app.AndroidHarness( 2106):
D/dalvikvm( 2106): GC_CONCURRENT freed 93K, 2% free 9033K/9156K, paused 5ms+4ms, total 36ms
D/dalvikvm( 2106): WAIT_FOR_CONCURRENT_GC blocked 28ms
W/dalvikvm( 2106): threadid=1: thread exiting with uncaught exception (group=0x40bb1930)
E/AndroidRuntime( 2106): FATAL EXCEPTION: main
E/AndroidRuntime( 2106): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mygame/com.mygame.MainActivity}: java.lang.NullPointerException
E/AndroidRuntime( 2106): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
E/AndroidRuntime( 2106): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
E/AndroidRuntime( 2106): at android.app.ActivityThread.access$600(ActivityThread.java:141)
E/AndroidRuntime( 2106): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
E/AndroidRuntime( 2106): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 2106): at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime( 2106): at android.app.ActivityThread.main(ActivityThread.java:5041)
E/AndroidRuntime( 2106): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 2106): at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime( 2106): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
E/AndroidRuntime( 2106): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
E/AndroidRuntime( 2106): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 2106): Caused by: java.lang.NullPointerException
E/AndroidRuntime( 2106): at com.jme3.app.AndroidHarness.onCreate(AndroidHarness.java:235)
E/AndroidRuntime( 2106): at android.app.Activity.performCreate(Activity.java:5104)
E/AndroidRuntime( 2106): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
E/AndroidRuntime( 2106): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
E/AndroidRuntime( 2106): … 11 more
W/ActivityManager( 499): Force finishing activity com.mygame/.MainActivity

@InShadow Can you post the zip file for the project to see if I can run it on my nexus 7. Give me a drop box link or something like that with a exported .zip file.

I can post apk file, because I don’t know which zip you are referring to. But I presume it won’t work for you either. The error seems pretty clear to me, although I don’t know why I get it. I will try to check configuration again or just copy paste the code to the BasicGame which works. :smiley:

Check the build file (mobile-impl.xml), I think I had this issue once…unfortunately I don’t really remember how I fixed it…
At worst, if you can make the basic game to run just copy your source code to a working project.

I did just that and it works lol! :slight_smile:
I suspect the problem was in project configuration. My project was created with older version of SDK, while BasicGame I created just after updating to the latest SDK.
Hopefully it helps also someone else. :slight_smile:

I think it is a problem with the build script, I have the same problem. Its not copying the source from the main project over to the mobile folder so when it builds its missing all of that. All the assets are copied though.

I had the problem with the missing class definition for a custom library.
The .class files were not dexed and did not enter the final apk.
Even manual dexing would not work with an exception: bad file magic (cafebabe)

The solution is to compile everything with JDK 5 or 6, but never with 7!

I hope everyone who has the same error finds this solution helpful.

Hello i have the same problem here. Is it possible to use JDK 1.8.0_25 ?

No you can’t.
Android does not support jdk8 features.
You should compile your code against jdk6 to be sure to run on android.

Ok,

by the way i just solve the issue above by doing the following :
in the ‘important files’ of the project, locate the file ‘Android Main Activity’ and modify the variable ‘appClass’ set it to the complete name of your main class (example com.mycompany.com.MyMainClass)

Note : this java file does not need to compile in the project.

1 Like

@Woodworf Thank you very much. I solved by this way :slight_smile: