3

I am getting this error. Problem is that the "caused by" clause doesnt seem to give any more information.

12-25 19:34:05.050: E/AndroidRuntime(28888): Uncaught handler: thread main exiting due to uncaught exception
12-25 19:34:05.070: E/AndroidRuntime(28888): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{il.co.anykey.games.yaniv.pro/ui.YanivMultiPlayerClientActivity}: java.lang.InstantiationException: ui.YanivMultiPlayerClientActivity
12-25 19:34:05.070: E/AndroidRuntime(28888):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2424)
12-25 19:34:05.070: E/AndroidRuntime(28888):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2519)
12-25 19:34:05.070: E/AndroidRuntime(28888):    at android.app.ActivityThread.access$2200(ActivityThread.java:123)
12-25 19:34:05.070: E/AndroidRuntime(28888):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1870)
12-25 19:34:05.070: E/AndroidRuntime(28888):    at android.os.Handler.dispatchMessage(Handler.java:99)
12-25 19:34:05.070: E/AndroidRuntime(28888):    at android.os.Looper.loop(Looper.java:123)
12-25 19:34:05.070: E/AndroidRuntime(28888):    at android.app.ActivityThread.main(ActivityThread.java:4370)
12-25 19:34:05.070: E/AndroidRuntime(28888):    at java.lang.reflect.Method.invokeNative(Native Method)
12-25 19:34:05.070: E/AndroidRuntime(28888):    at java.lang.reflect.Method.invoke(Method.java:521)
12-25 19:34:05.070: E/AndroidRuntime(28888):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
12-25 19:34:05.070: E/AndroidRuntime(28888):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
12-25 19:34:05.070: E/AndroidRuntime(28888):    at dalvik.system.NativeStart.main(Native Method)
12-25 19:34:05.070: E/AndroidRuntime(28888): Caused by: java.lang.InstantiationException: ui.YanivMultiPlayerClientActivity
12-25 19:34:05.070: E/AndroidRuntime(28888):    at java.lang.Class.newInstanceImpl(Native Method)
12-25 19:34:05.070: E/AndroidRuntime(28888):    at java.lang.Class.newInstance(Class.java:1479)
12-25 19:34:05.070: E/AndroidRuntime(28888):    at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
12-25 19:34:05.070: E/AndroidRuntime(28888):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
12-25 19:34:05.070: E/AndroidRuntime(28888):    ... 11 more
12-25 19:34:05.110: E/SemcCheckin(28888): Get crash dump level : java.io.FileNotFoundException: /data/semc-checkin/crashdump
theblitz
  • 6,683
  • 16
  • 60
  • 114

1 Answers1

4

Does your ui.YanivMultiPlayerClientActivity have a public parameterless constructor? It looks like it's failing to instantiate it. Reasons that might be the case:

  • The class could be abstract (as it turns out is the case)
  • The class could have no parameterless constructors
  • A parameterless constructor could exist, but not be public
  • The constructor could be throwing an exception (which I'd expect to be included as a further cause)
  • The class could be an inner class that was not declared static.
NVRAM
  • 6,947
  • 10
  • 41
  • 44
Jon Skeet
  • 1,421,763
  • 867
  • 9,128
  • 9,194
  • It has the standard "public void onCreate(Bundle savedInstanceState)" constructor. I commented out all the code except for the "super" and it still fails. – theblitz Dec 25 '11 at 18:50
  • Sorry. My mind was miles away. I have no constructor defined so I assume it is using the default one. – theblitz Dec 25 '11 at 20:19
  • @theblitz: Can you create a short but complete program which demonstrates the problem (as close as possible in Android)? – Jon Skeet Dec 25 '11 at 20:34
  • 4
    Solved! Seems that my class had been changed to abstract when I was playing around with the interfaces it implements. Grrrr. – theblitz Dec 25 '11 at 20:42
  • @theblitz Great Comment, Helpful a lot.. please post it as answer and accept that .. cause that will be the correct solution for the same.. not the current one.. – MKJParekh Nov 23 '12 at 11:18
  • @MKJParekh Is it ok to select your own answer as correct one? – theblitz Jan 24 '13 at 14:30
  • @theblitz: Yes, although I'd argue that it's not *likely* to help others (as the chances of them making the same mistake are slim). I suggest that I edit my answer to list *various* reasons this could happen. – Jon Skeet Jan 24 '13 at 14:32
  • @theblitz Yeh, I was bit stupid saying the above comment.. I should have thought another way by editing the current answer.. anyways Jon helped the correct way.. – MKJParekh Jan 25 '13 at 06:33