我已完成並設法安裝該應用程序(我正在學習一個教程),但是在模擬器或真實設備上運行它時,它給了我錯誤消息,不幸的是,停止。不幸的是,「appname」已停止
登錄貓
11-27 09:57:54.669: I/Process(1373): Sending signal. PID: 1373 SIG: 9
11-27 09:58:08.729: D/AndroidRuntime(1397): Shutting down VM
11-27 09:58:08.729: W/dalvikvm(1397): threadid=1: thread exiting with uncaught exception (group=0xb3aa4b90)
11-27 09:58:08.899: E/AndroidRuntime(1397): FATAL EXCEPTION: main
11-27 09:58:08.899: E/AndroidRuntime(1397): Process: com.davidgassner.plainolnotes, PID: 1397
11-27 09:58:08.899: E/AndroidRuntime(1397): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.davidgassner.plainolnotes/com.davidgassner.plainolnotes.Quick_Note_Taker} : java.lang.ClassNotFoundException: Didn't find class "com.davidgassner.plainolnotes.Quick_Note_Taker" on path: DexPathList[[zip file "/data/app/com.davidgassner.plainolnotes-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.davidgassner.plainolnotes-2, /system/lib]]
11-27 09:58:08.899: E/AndroidRuntime(1397): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2102)
11-27 09:58:08.899: E/AndroidRuntime(1397): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2226)
11-27 09:58:08.899: E/AndroidRuntime(1397): at android.app.ActivityThread.access$700(ActivityThread.java:135)
11-27 09:58:08.899: E/AndroidRuntime(1397): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1397)
11-27 09:58:08.899: E/AndroidRuntime(1397): at android.os.Handler.dispatchMessage(Handler.java:102)
11-27 09:58:08.899: E/AndroidRuntime(1397): at android.os.Looper.loop(Looper.java:137)
11-27 09:58:08.899: E/AndroidRuntime(1397): at android.app.ActivityThread.main(ActivityThread.java:4998)
11-27 09:58:08.899: E/AndroidRuntime(1397): at java.lang.reflect.Method.invokeNative(Native Method)
11-27 09:58:08.899: E/AndroidRuntime(1397): at java.lang.reflect.Method.invoke(Method.java:515)
11-27 09:58:08.899: E/AndroidRuntime(1397): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:777)
11-27 09:58:08.899: E/AndroidRuntime(1397): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:593)
11-27 09:58:08.899: E/AndroidRuntime(1397): at dalvik.system.NativeStart.main(Native Method)
11-27 09:58:08.899: E/AndroidRuntime(1397): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.davidgassner.plainolnotes.Quick_Note_Taker" on path: DexPathList[[zip file "/data/app/com.davidgassner.plainolnotes-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.davidgassner.plainolnotes-2, /system/lib]]
11-27 09:58:08.899: E/AndroidRuntime(1397): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
11-27 09:58:08.899: E/AndroidRuntime(1397): at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
11-27 09:58:08.899: E/AndroidRuntime(1397): at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
11-27 09:58:08.899: E/AndroidRuntime(1397): at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
11-27 09:58:08.899: E/AndroidRuntime(1397): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2093)
11-27 09:58:08.899: E/AndroidRuntime(1397): ... 11 more
AndroidManifest.xml中
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.davidgassner.plainolnotes"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="13"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label=" Quick Note Taker"
android:theme="@style/AppTheme" >
<activity
android:name="Quick_Note_Taker"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".NoteEditorActivity"/>
</application>
</manifest>
誰能幫我找出這個問題的根源是什麼?如果需要其他東西,告訴我。
謝謝先進。
Quick_Note_Taker是否在清單中定義爲Activity?你有沒有嘗試一個乾淨的和重建? – NigelK
是的,它被定義爲一項活動。我已經嘗試了一次清理和重建。 – user3024404
你是否在清單中添加了所有類? –