我是这个应用程序的新手,我正在按照教程学习。我跟着https://github.com/survivingwithandroid/Surviving-with-android/tree/master/WeatherForecastApp来测试天气应用程序,但我正在逼近。我也对这个错误进行了检查,但我仍然无法解决。如果有人遇到此错误,请提供帮助。
Logcat 错误
E/AndroidRuntime(5988): FATAL EXCEPTION: main
E/AndroidRuntime(5988): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.survivingwithandroid.weatherapp/com.survivingwithandroid.weatherapp.MainActivity}: java.lang.ClassNotFoundException: com.survivingwithandroid.weatherapp.MainActivity in loader dalvik.system.PathClassLoader[/data/app/com.survivingwithandroid.weatherapp-2.apk]
E/AndroidRuntime(5988): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1573)
E/AndroidRuntime(5988): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
E/AndroidRuntime(5988): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
E/AndroidRuntime(5988): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
E/AndroidRuntime(5988): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(5988): at android.os.Looper.loop(Looper.java:130)
E/AndroidRuntime(5988): at android.app.ActivityThread.main(ActivityThread.java:3687)
E/AndroidRuntime(5988): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(5988): at java.lang.reflect.Method.invoke(Method.java:507)
E/AndroidRuntime(5988): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
E/AndroidRuntime(5988): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
E/AndroidRuntime(5988): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(5988): Caused by: java.lang.ClassNotFoundException: com.survivingwithandroid.weatherapp.MainActivity in loader dalvik.system.PathClassLoader[/data/app/com.survivingwithandroid.weatherapp-2.apk]
E/AndroidRuntime(5988): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
E/AndroidRuntime(5988): at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
E/AndroidRuntime(5988): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
E/AndroidRuntime(5988): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
E/AndroidRuntime(5988): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1565)
E/AndroidRuntime(5988): ... 11 more