【问题标题】:Sample weather app getting force close示例天气应用程序强制关闭
【发布时间】:2013-10-30 06:40:20
【问题描述】:

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

【问题讨论】:

标签: android weather


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 2011-08-27
    • 2013-01-25
    • 2014-06-22
    • 1970-01-01
    • 2014-12-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多