当我在API 8上的模拟器上运行我的应用程序时会发生这种情况,但在我的手机上运行正常:
03-08 23:51:46.683: I/dalvikvm(414): Failed resolving Lcom/matthewmitchell/wakeify/MainActivity; interface 24 'Landroid/app/LoaderManager$LoaderCallbacks;'
03-08 23:51:46.683: W/dalvikvm(414): Link of class 'Lcom/matthewmitchell/wakeify/MainActivity;' failed
03-08 23:51:46.693: D/AndroidRuntime(414): Shutting down VM
03-08 23:51:46.693: W/dalvikvm(414): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
03-08 23:51:46.713: E/AndroidRuntime(414): FATAL EXCEPTION: main
03-08 23:51:46.713: E/AndroidRuntime(414): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.matthewmitchell.wakeify/com.matthewmitchell.wakeify.MainActivity}: java.lang.ClassNotFoundException: com.matthewmitchell.wakeify.MainActivity in loader dalvik.system.PathClassLoader[/data/app/com.matthewmitchell.wakeify-2.apk]
03-08 23:51:46.713: E/AndroidRuntime(414): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2585)
03-08 23:51:46.713: E/AndroidRuntime(414): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
03-08 23:51:46.713: E/AndroidRuntime(414): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
03-08 23:51:46.713: E/AndroidRuntime(414): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
03-08 23:51:46.713: E/AndroidRuntime(414): at android.os.Handler.dispatchMessage(Handler.java:99)
03-08 23:51:46.713: E/AndroidRuntime(414): at android.os.Looper.loop(Looper.java:123)
03-08 23:51:46.713: E/AndroidRuntime(414): at android.app.ActivityThread.main(ActivityThread.java:4627)
03-08 23:51:46.713: E/AndroidRuntime(414): at java.lang.reflect.Method.invokeNative(Native Method)
03-08 23:51:46.713: E/AndroidRuntime(414): at java.lang.reflect.Method.invoke(Method.java:521)
03-08 23:51:46.713: E/AndroidRuntime(414): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
03-08 23:51:46.713: E/AndroidRuntime(414): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
03-08 23:51:46.713: E/AndroidRuntime(414): at dalvik.system.NativeStart.main(Native Method)
03-08 23:51:46.713: E/AndroidRuntime(414): Caused by: java.lang.ClassNotFoundException: com.matthewmitchell.wakeify.MainActivity in loader dalvik.system.PathClassLoader[/data/app/com.matthewmitchell.wakeify-2.apk]
03-08 23:51:46.713: E/AndroidRuntime(414): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
03-08 23:51:46.713: E/AndroidRuntime(414): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
03-08 23:51:46.713: E/AndroidRuntime(414): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
03-08 23:51:46.713: E/AndroidRuntime(414): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
03-08 23:51:46.713: E/AndroidRuntime(414): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)
活动在清单中如下:
<activity
android:name=".MainActivity"
android:label="@string/title_activity_main" >
<intent-filter android:label="@string/app_name">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
在模拟器上的API级别8上可能导致此行为的原因是什么?
谢谢。