Domanda

I am getting a CloneNotSupportedException, but I cannot find anywhere in my code where I call clone(). I have looked in the Java Docs and I cannot find any reason for this exception to be thrown other than me calling clone() on an object.

Does anyone know of another reason for this exception to be called? Is clone() called when I set an object equal to another object? None of my classes implement Cloneable.

Here is my LogCat :

08-03 13:04:02.751: E/AndroidRuntime(3223): FATAL EXCEPTION: main
08-03 13:04:02.751: E/AndroidRuntime(3223): java.lang.RuntimeException: Unable to start activity ComponentInfo{my.eti.commander/my.eti.commander.MainMenu}: java.lang.CloneNotSupportedException: Class doesn't implement Cloneable
08-03 13:04:02.751: E/AndroidRuntime(3223):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
08-03 13:04:02.751: E/AndroidRuntime(3223):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
08-03 13:04:02.751: E/AndroidRuntime(3223):     at android.app.ActivityThread.access$1500(ActivityThread.java:117)
08-03 13:04:02.751: E/AndroidRuntime(3223):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
08-03 13:04:02.751: E/AndroidRuntime(3223):     at android.os.Handler.dispatchMessage(Handler.java:99)
08-03 13:04:02.751: E/AndroidRuntime(3223):     at android.os.Looper.loop(Looper.java:130)
08-03 13:04:02.751: E/AndroidRuntime(3223):     at android.app.ActivityThread.main(ActivityThread.java:3683)
08-03 13:04:02.751: E/AndroidRuntime(3223):     at java.lang.reflect.Method.invokeNative(Native Method)
08-03 13:04:02.751: E/AndroidRuntime(3223):     at java.lang.reflect.Method.invoke(Method.java:507)
08-03 13:04:02.751: E/AndroidRuntime(3223):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
08-03 13:04:02.751: E/AndroidRuntime(3223):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
08-03 13:04:02.751: E/AndroidRuntime(3223):     at dalvik.system.NativeStart.main(Native Method)
08-03 13:04:02.751: E/AndroidRuntime(3223): Caused by: java.lang.CloneNotSupportedException: Class doesn't implement Cloneable
08-03 13:04:02.751: E/AndroidRuntime(3223):     at java.lang.Object.clone(Object.java:155)
08-03 13:04:02.751: E/AndroidRuntime(3223):     at my.eti.commander.RelayAPIModel$NativeCalls.InitRelayJava(Native Method)
08-03 13:04:02.751: E/AndroidRuntime(3223):     at my.eti.commander.MainMenu.initMain(MainMenu.java:241)
08-03 13:04:02.751: E/AndroidRuntime(3223):     at my.eti.commander.MainMenu.onCreate(MainMenu.java:81)
08-03 13:04:02.751: E/AndroidRuntime(3223):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
08-03 13:04:02.751: E/AndroidRuntime(3223):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
08-03 13:04:02.751: E/AndroidRuntime(3223):     ... 11 more
È stato utile?

Soluzione

From the stack trace I would guess that there is something in your native code in

my.eti.commander.RelayAPIModel$NativeCalls.InitRelayJava(Native Method)

that is trying to clone a Java object passed to it and that object doesn't support Cloneable.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top