Java Android应用程序启动时崩溃,出现致命异常
我在LogCat中收到以下代码错误…有修复吗?什么是info.androidhive.androidsplashscrentimer.Splashscreen?我想在主要活动之前显示启动屏幕。是否有人能向我解释一下,为了找出log cat产生的问题,需要查看哪些错误消息Java Android应用程序启动时崩溃,出现致命异常,java,android,Java,Android,我在LogCat中收到以下代码错误…有修复吗?什么是info.androidhive.androidsplashscrentimer.Splashscreen?我想在主要活动之前显示启动屏幕。是否有人能向我解释一下,为了找出log cat产生的问题,需要查看哪些错误消息 06-09 11:43:18.800: E/AndroidRuntime(824): FATAL EXCEPTION: main 06-09 11:43:18.800: E/AndroidRuntime(824): Proces
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>
您的包
com.example.apolypse
与您的活动中的包不匹配(info.androidhive.androidsplashscrentimer
),或者您将活动元素name=“.SplashScreen”
或name=“com.example.apolypse.splashscrentimer”
,但不是info.androidhive.androidsplashscrentimer.SplashScreen
。试试这个:
<?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=".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=".MainActivity"
android:label="@string/app_name" >
</activity>
</application>
看起来您的舱单可能有问题-您可以发布吗?您的包裹不匹配。你有com.example.apocalype
和你的活动info.androidhive.androidsplashscrentimer