我已经构建了一个名为EverestNewsApp的与RSS Feed相关的Android应用程序,以便显示当前新闻和头条新闻,但毕竟我收到了错误,但应用程序很遗憾地停止了。你能不能看看下面的日志cat错误,并告诉我我犯了什么错误...提前感谢
08-06 19:41:35.395: D/AndroidRuntime(23995): Shutting down VM
08-06 19:41:35.430: W/dalvikvm(23995): threadid=1: thread exiting with uncaught exception (group=0x41a692a0)
08-06 19:41:35.430: E/AndroidRuntime(23995): FATAL EXCEPTION: main
08-06 19:41:35.430: E/AndroidRuntime(23995): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.wfwf.everestnewsapp/com.wfwf.everestnewsapp.SplashActivity}: java.lang.ClassNotFoundException: com.wfwf.everestnewsapp.SplashActivity
08-06 19:41:35.430: E/AndroidRuntime(23995): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2024)
08-06 19:41:35.430: E/AndroidRuntime(23995): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2125)
08-06 19:41:35.430: E/AndroidRuntime(23995): at android.app.ActivityThread.access$600(ActivityThread.java:140)
08-06 19:41:35.430: E/AndroidRuntime(23995): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1227)
08-06 19:41:35.430: E/AndroidRuntime(23995): at android.os.Handler.dispatchMessage(Handler.java:99)
08-06 19:41:35.430: E/AndroidRuntime(23995): at android.os.Looper.loop(Looper.java:137)
08-06 19:41:35.430: E/AndroidRuntime(23995): at android.app.ActivityThread.main(ActivityThread.java:4898)
08-06 19:41:35.430: E/AndroidRuntime(23995): at java.lang.reflect.Method.invokeNative(Native Method)
08-06 19:41:35.430: E/AndroidRuntime(23995): at java.lang.reflect.Method.invoke(Method.java:511)
08-06 19:41:35.430: E/AndroidRuntime(23995): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1006)
08-06 19:41:35.430: E/AndroidRuntime(23995): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
08-06 19:41:35.430: E/AndroidRuntime(23995): at dalvik.system.NativeStart.main(Native Method)
08-06 19:41:35.430: E/AndroidRuntime(23995): Caused by: java.lang.ClassNotFoundException: com.wfwf.everestnewsapp.SplashActivity
08-06 19:41:35.430: E/AndroidRuntime(23995): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
08-06 19:41:35.430: E/AndroidRuntime(23995): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
08-06 19:41:35.430: E/AndroidRuntime(23995): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
08-06 19:41:35.430: E/AndroidRuntime(23995): at android.app.Instrumentation.newActivity(Instrumentation.java:1057)
08-06 19:41:35.430: E/AndroidRuntime(23995): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2015)
08-06 19:41:35.430: E/AndroidRuntime(23995): ... 11 more
08-06 19:41:35.465: I/Process(23995): Sending signal. PID: 23995 SIG: 9
答案 0 :(得分:1)
java.lang.ClassNotFoundException:com.wfwf.everestnewsapp.SplashActivity: 这个错误基本上都显示了 编译器无法实例化您的SplashActivity.java
确保您已在AndroidManifest.xml中定义了SplashActivity类
答案 1 :(得分:1)
您的Android清单需要看起来像这样
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme">
....
....
<activity
android:name="com.wfwf.everestnewsapp.SplashActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
确保条目在您的清单中,否则您将获得classnotfound异常