运行时出错 - 该怎么办?

时间:2013-02-07 14:36:01

标签: android mobile runtime-error

这个错误是什么意思?我在运行时遇到这个错误。当我尝试启动时,应用程序崩溃了。我是Android编程新手。

我试图查看代码,但找不到它。我很感激你的帮助。

02-07 14:32:57.967: E/Trace(943): error opening trace file: No such file or directory (2)
02-07 14:32:58.386: E/AndroidRuntime(943): FATAL EXCEPTION: main
02-07 14:32:58.386: E/AndroidRuntime(943): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.quiz/com.example.quiz.Splash}: java.lang.ClassNotFoundException: Didn't find class "com.example.quiz.Splash" on path: /data/app/com.example.quiz-2.apk
02-07 14:32:58.386: E/AndroidRuntime(943):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2106)
02-07 14:32:58.386: E/AndroidRuntime(943):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
02-07 14:32:58.386: E/AndroidRuntime(943):  at android.app.ActivityThread.access$600(ActivityThread.java:141)
02-07 14:32:58.386: E/AndroidRuntime(943):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
02-07 14:32:58.386: E/AndroidRuntime(943):  at android.os.Handler.dispatchMessage(Handler.java:99)
02-07 14:32:58.386: E/AndroidRuntime(943):  at android.os.Looper.loop(Looper.java:137)
02-07 14:32:58.386: E/AndroidRuntime(943):  at android.app.ActivityThread.main(ActivityThread.java:5039)
02-07 14:32:58.386: E/AndroidRuntime(943):  at java.lang.reflect.Method.invokeNative(Native Method)
02-07 14:32:58.386: E/AndroidRuntime(943):  at java.lang.reflect.Method.invoke(Method.java:511)
02-07 14:32:58.386: E/AndroidRuntime(943):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
02-07 14:32:58.386: E/AndroidRuntime(943):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
02-07 14:32:58.386: E/AndroidRuntime(943):  at dalvik.system.NativeStart.main(Native Method)
02-07 14:32:58.386: E/AndroidRuntime(943): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.example.quiz.Splash" on path: /data/app/com.example.quiz-2.apk
02-07 14:32:58.386: E/AndroidRuntime(943):  at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65)
02-07 14:32:58.386: E/AndroidRuntime(943):  at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
02-07 14:32:58.386: E/AndroidRuntime(943):  at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
02-07 14:32:58.386: E/AndroidRuntime(943):  at android.app.Instrumentation.newActivity(Instrumentation.java:1054)
02-07 14:32:58.386: E/AndroidRuntime(943):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2097)
02-07 14:32:58.386: E/AndroidRuntime(943):  ... 11 more

2 个答案:

答案 0 :(得分:0)

  1. 首先,检查您的源是否在错误日志中提到的位置。
  2. 如果是,请检查您是否犯了任何打字错误
  3. 如果它仍然不起作用,那么创建一个新项目并重命名缺少的内容会更容易(在我看来)(我已经多次完成这项工作并且它一直有效)当然,请确保你复制了所有的代码

答案 1 :(得分:0)

看起来你错过了清单中的Splash活动。

    <activity android:name=".Splash"/>

查看您的清单中是否显示该行,如果不是,则应添加该行。