0

我是这个应用程序的新手,我正在按照教程学习。我跟着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
4

1 回答 1

0

在我看来,您没有从 GitHub 正确下载该项目。如果您仍然遇到此问题,请告诉我,并尝试从 Github 下载它以检查我共享的项目是否存在问题。谢谢

于 2014-04-03T07:41:06.847 回答