我在LogCat中遇到以下代码错误...任何修复?什么是info.androidhive.androidsplashscreentimer.Splashscreen?我想在主要活动之前显示启动画面。任何人都可以向我解释为了找出log cat生成的问题,要查看哪些错误消息?
06-09 11:43:18.800: E/AndroidRuntime(824): FATAL EXCEPTION: main
06-09 11:43:18.800: E/AndroidRuntime(824): Process: com.example.apocalypse, PID: 824
06-09 11:43:18.800: E/AndroidRuntime(824): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.apocalypse/info.androidhive.androidsplashscreentimer.SplashScreen}: java.lang.ClassNotFoundException: Didn't find class "info.androidhive.androidsplashscreentimer.SplashScreen" on path: DexPathList[[zip file "/data/app/com.example.apocalypse-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.apocalypse-2, /system/lib]]
06-09 11:43:18.800: E/AndroidRuntime(824): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2121)
06-09 11:43:18.800: E/AndroidRuntime(824): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
06-09 11:43:18.800: E/AndroidRuntime(824): at android.app.ActivityThread.access$800(ActivityThread.java:135)
06-09 11:43:18.800: E/AndroidRuntime(824): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
06-09 11:43:18.800: E/AndroidRuntime(824): at android.os.Handler.dispatchMessage(Handler.java:102)
06-09 11:43:18.800: E/AndroidRuntime(824): at android.os.Looper.loop(Looper.java:136)
06-09 11:43:18.800: E/AndroidRuntime(824): at android.app.ActivityThread.main(ActivityThread.java:5017)
06-09 11:43:18.800: E/AndroidRuntime(824): at java.lang.reflect.Method.invokeNative(Native Method)
06-09 11:43:18.800: E/AndroidRuntime(824): at java.lang.reflect.Method.invoke(Method.java:515)
06-09 11:43:18.800: E/AndroidRuntime(824): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
06-09 11:43:18.800: E/AndroidRuntime(824): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
06-09 11:43:18.800: E/AndroidRuntime(824): at dalvik.system.NativeStart.main(Native Method)
06-09 11:43:18.800: E/AndroidRuntime(824): Caused by: java.lang.ClassNotFoundException: Didn't find class "info.androidhive.androidsplashscreentimer.SplashScreen" on path: DexPathList[[zip file "/data/app/com.example.apocalypse-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.apocalypse-2, /system/lib]]
06-09 11:43:18.800: E/AndroidRuntime(824): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
06-09 11:43:18.800: E/AndroidRuntime(824): at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
06-09 11:43:18.800: E/AndroidRuntime(824): at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
06-09 11:43:18.800: E/AndroidRuntime(824): at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
06-09 11:43:18.800: E/AndroidRuntime(824): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2112)
06-09 11:43:18.800: E/AndroidRuntime(824): ... 11 more
06-09 11:43:24.160: I/Process(824): Sending signal. PID: 824 SIG: 9
06-09 11:43:45.990: D/AndroidRuntime(929): Shutting down VM
06-09 11:43:45.990: W/dalvikvm(929): threadid=1: thread exiting with uncaught exception (group=0xb2a79ba8)
06-09 11:43:46.000: E/AndroidRuntime(929): FATAL EXCEPTION: main
06-09 11:43:46.000: E/AndroidRuntime(929): Process: com.example.apocalypse, PID: 929
06-09 11:43:46.000: E/AndroidRuntime(929): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.apocalypse/info.androidhive.androidsplashscreentimer.SplashScreen}: java.lang.ClassNotFoundException: Didn't find class "info.androidhive.androidsplashscreentimer.SplashScreen" on path: DexPathList[[zip file "/data/app/com.example.apocalypse-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.apocalypse-2, /system/lib]]
06-09 11:43:46.000: E/AndroidRuntime(929): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2121)
06-09 11:43:46.000: E/AndroidRuntime(929): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
06-09 11:43:46.000: E/AndroidRuntime(929): at android.app.ActivityThread.access$800(ActivityThread.java:135)
06-09 11:43:46.000: E/AndroidRuntime(929): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
06-09 11:43:46.000: E/AndroidRuntime(929): at android.os.Handler.dispatchMessage(Handler.java:102)
06-09 11:43:46.000: E/AndroidRuntime(929): at android.os.Looper.loop(Looper.java:136)
06-09 11:43:46.000: E/AndroidRuntime(929): at android.app.ActivityThread.main(ActivityThread.java:5017)
06-09 11:43:46.000: E/AndroidRuntime(929): at java.lang.reflect.Method.invokeNative(Native Method)
06-09 11:43:46.000: E/AndroidRuntime(929): at java.lang.reflect.Method.invoke(Method.java:515)
06-09 11:43:46.000: E/AndroidRuntime(929): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
06-09 11:43:46.000: E/AndroidRuntime(929): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
06-09 11:43:46.000: E/AndroidRuntime(929): at dalvik.system.NativeStart.main(Native Method)
06-09 11:43:46.000: E/AndroidRuntime(929): Caused by: java.lang.ClassNotFoundException: Didn't find class "info.androidhive.androidsplashscreentimer.SplashScreen" on path: DexPathList[[zip file "/data/app/com.example.apocalypse-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.apocalypse-2, /system/lib]]
06-09 11:43:46.000: E/AndroidRuntime(929): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
06-09 11:43:46.000: E/AndroidRuntime(929): at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
06-09 11:43:46.000: E/AndroidRuntime(929): at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
06-09 11:43:46.000: E/AndroidRuntime(929): at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
06-09 11:43:46.000: E/AndroidRuntime(929): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2112)
06-09 11:43:46.000: E/AndroidRuntime(929): ... 11 more
我的清单是
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.apocalypse"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<!-- Splash screen -->
<activity
android:name="info.androidhive.androidsplashscreentimer.SplashScreen"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.Black.NoTitleBar" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- Main activity -->
<activity
android:name="info.androidhive.androidsplashscreentimer.MainActivity"
android:label="@string/app_name" >
</activity>
</application>
答案 0 :(得分:2)
您的文件包com.example.apocalypse
与您的活动(info.androidhive.androidsplashscreentimer
)中的文章不符,您要么放入活动元素name=".SplashScreen"
或name="com.example.apocalypse.SplashScreen"
,而不是{{1} }}。试试这个:
info.androidhive.androidsplashscreentimer.SplashScreen