我得到这个错误。问题是"由于"这句话似乎并没有提供更多的信息。
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
您的ui.YanivMultiPlayerClientActivity
是否有一个公共无参数构造函数?看起来它没有实例化它。可能的原因:
- 类可以是抽象的(事实证明是这样)
- 类不能有无参数构造函数
- 可以存在无参数构造函数,但不能是公共的
- 构造函数可能会抛出异常(我希望作为进一步的原因包含)
- 类可以是未声明的内部类static。