当前位置:酷酷问答>百科问答>java.lang.RuntimeException

java.lang.RuntimeException

2024-10-26 01:15:56 编辑:zane 浏览量:549

java.lang.RuntimeException

的有关信息介绍如下:

java.lang.RuntimeException

05-21 10:03:03.916: E/AndroidRuntime(18573): FATAL EXCEPTION: main

05-21 10:03:03.916: E/AndroidRuntime(18573): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.tomato/com.example.alarmtest.AppStart}: java.lang.ClassNotFoundException: com.example.alarmtest.AppStart

05-21 10:03:03.916: E/AndroidRuntime(18573): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2110)

05-21 10:03:03.916: E/AndroidRuntime(18573): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2229)

05-21 10:03:03.916: E/AndroidRuntime(18573): at android.app.ActivityThread.access$600(ActivityThread.java:139)

05-21 10:03:03.916: E/AndroidRuntime(18573): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1261)

05-21 10:03:03.916: E/AndroidRuntime(18573): at android.os.Handler.dispatchMessage(Handler.java:99)

05-21 10:03:03.916: E/AndroidRuntime(18573): at android.os.Looper.loop(Looper.java:154)

05-21 10:03:03.916: E/AndroidRuntime(18573): at android.app.ActivityThread.main(ActivityThread.java:4944)

05-21 10:03:03.916: E/AndroidRuntime(18573): at java.lang.reflect.Method.invokeNative(Native Method)

05-21 10:03:03.916: E/AndroidRuntime(18573): at java.lang.reflect.Method.invoke(Method.java:511)

05-21 10:03:03.916: E/AndroidRuntime(18573): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)

05-21 10:03:03.916: E/AndroidRuntime(18573): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)

05-21 10:03:03.916: E/AndroidRuntime(18573): at dalvik.system.NativeStart.main(Native Method)

05-21 10:03:03.916: E/AndroidRuntime(18573): Caused by: java.lang.ClassNotFoundException: com.example.alarmtest.AppStart

05-21 10:03:03.916: E/AndroidRuntime(18573): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)

05-21 10:03:03.916: E/AndroidRuntime(18573): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)

05-21 10:03:03.916: E/AndroidRuntime(18573): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)

05-21 10:03:03.916: E/AndroidRuntime(18573): at android.app.Instrumentation.newActivity(Instrumentation.java:1039)

05-21 10:03:03.916: E/AndroidRuntime(18573): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2101)

一般出现这个问题主要是没有在项目的androidManifest.xml里注册使用activity,主要就是这句:java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.tomato/com.example.alarmtest.AppStart}: java.lang.ClassNotFoundException: com.example.alarmtest.AppStart

上面它已经就说,你没有实例化com.example.tomato/com.example.alarmtest.AppStart,tomato是项目名字,AppStart是没有实例化的activity。这就明白了,检查这下,注册

但有时你发觉你已经注册,这时你要仔细检查,看看是不是包名写错了,仔细排查错误。就能解决了。

版权声明:文章由 酷酷问答 整理收集,来源于互联网或者用户投稿,如有侵权,请联系我们,我们会立即处理。如转载请保留本文链接:https://www.kukuwd.com/answer/94972.html
热门文章