I receive this exception in Cocos2dx on Android, any idea what could be the reason for that?
FATAL EXCEPTION: GLThread 10 java.lang.CloneNotSupportedException: Class doesn’t implement Cloneable at java.lang.Object.clone(Object.java:155) at org.cocos2dx.lib.Cocos2dxRenderer.nativeInit(Native Method) at org.cocos2dx.lib.Cocos2dxRenderer.onSurfaceCreated(Cocos2dxRenderer.java:72) at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1348) at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1118)
I had the same error and have solved it for my case, though mine said GLThread 11:
FATAL EXCEPTION: GLThread 11
java.lang.CloneNotSupportedException: Class doesn't implement Cloneable
at java.lang.Object.clone(Object.java:155)
at org.cocos2dx.lib.Cocos2dxRenderer.nativeInit(Native Method)
at org.cocos2dx.lib.Cocos2dxRenderer.onSurfaceCreated(Cocos2dxRenderer.java:72)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1348)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1118)
and I traced my error to an invalid JNI call.
I was incorrectly pairing GetStaticMethodInfo with a non-static CallMethod function. In my specific case it was:
GetStaticMethodInfo(…)
(int)t.env~~>CallIntMethod
when it needed to be
GetStaticMethodInfo
t.env~~>CallStaticIntMethod(…)
In my case it also was bad JNI call ;/
But no logs about crash only useless stack trace
FATAL EXCEPTION: GLThread 8
java.lang.CloneNotSupportedException: Class doesn’t implement Cloneable
at java.lang.Object.clone(Object.java:155)
at org.cocos2dx.lib.Cocos2dxRenderer.nativeInit(Native Method)
at org.cocos2dx.lib.Cocos2dxRenderer.onSurfaceCreated(Cocos2dxRenderer.java:72)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1348)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1118)
My mistake was
I call static method with such call
method.env~~>CallVoidMethod ;
And it should be
method.env~~>CallStaticVoidMethod ( method.classID, method.methodID, false );
Funny on Android 4.0 > it was working fine on android < 4.0 app crash Thx for tip to look in JNI