Java 应用程序sati(process com.example.sati)意外停止。请重试
我正在制作一个应用程序,其中有一个splash类,当应用程序运行时包含一个要显示的图像,另一个类用于添加和减去一个数字,它将在第一个图像出现后显示 manifest.xmlJava 应用程序sati(process com.example.sati)意外停止。请重试,java,android,eclipse,syntax-error,Java,Android,Eclipse,Syntax Error,我正在制作一个应用程序,其中有一个splash类,当应用程序运行时包含一个要显示的图像,另一个类用于添加和减去一个数字,它将在第一个图像出现后显示 manifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.sati" android:versionCode
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.sati"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="18" />// here shows a warning saying"Not targeting the latest versions of Android; compatibility modes apply. Consider testing and updating this version. Consult the android.os.Build.VERSION_CODES javadoc for details."
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".SplashAct"
//it's the class 'splash' containing an image that shows up on start of an app
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"//it's a class that will appear after 'splash class'
android:label="@string/app_name" >
<intent-filter>
<action android:name="com.example.sati.MAINACTIVITY" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>
following is the code of xml file named splash
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@drawable/splash">
</LinearLayout>
Logcat
03-24 13:26:23.285: W/dalvikvm(328): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
03-24 13:26:23.355: E/AndroidRuntime(328): FATAL EXCEPTION: main
03-24 13:26:23.355: E/AndroidRuntime(328): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.sati/com.example.sati.SplashAct}: java.lang.ClassNotFoundException: com.example.sati.SplashAct in loader dalvik.system.PathClassLoader[/data/app/com.example.sati-1.apk]
03-24 13:26:23.355: E/AndroidRuntime(328): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2585)
03-24 13:26:23.355: E/AndroidRuntime(328): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
03-24 13:26:23.355: E/AndroidRuntime(328): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
03-24 13:26:23.355: E/AndroidRuntime(328): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
03-24 13:26:23.355: E/AndroidRuntime(328): at android.os.Handler.dispatchMessage(Handler.java:99)
03-24 13:26:23.355: E/AndroidRuntime(328): at android.os.Looper.loop(Looper.java:123)
03-24 13:26:23.355: E/AndroidRuntime(328): at android.app.ActivityThread.main(ActivityThread.java:4 627)
03-24 13:26:23.355: E/AndroidRuntime(328): at java.lang.reflect.Method.invokeNative(Native Method)
03-24 13:26:23.355: E/AndroidRuntime(328): at java.lang.reflect.Method.invoke(Method.java:521)
03-24 13:26:23.355: E/AndroidRuntime(328): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
03-24 13:26:23.355: E/AndroidRuntime(328): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
03-24 13:26:23.355: E/AndroidRuntime(328): at dalvik.system.NativeStart.main(Native Method)
03-24 13:26:23.355: E/AndroidRuntime(328): Caused by: java.lang.ClassNotFoundException: com.example.sati.SplashAct in loader dalvik.system.PathClassLoader[/data/app/com.example.sati-1.apk]
03-24 13:26:23.355: E/AndroidRuntime(328): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
03-24 13:26:23.355: E/AndroidRuntime(328): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
03-24 13:26:23.355: E/AndroidRuntime(328): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
03-24 13:26:23.355: E/AndroidRuntime(328): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
03-24 13:26:23.355: E/AndroidRuntime(328): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)
03-24 13:26:23.355: E/AndroidRuntime(328): ... 11 more
您的清单声称存在活动类
SplashAct
,但您发布的代码只有Splash
。确保清单和代码具有相同的完整类名
Caused by: java.lang.ClassNotFoundException: com.example.sati.SplashAct
你有
public class Splash extends Activity { // Activity Name is Splash not SplashAct
所以改变这个
<activity
android:name=".SplashAct"
您可以发布您的软件包名称吗SplashAct@Raghunandan它的包名是com.example.satia,但是为什么我不能理解Logcat中显示的错误!!!我讨厌它…@user3431536看看loader dalvik.system.PathClassLoader[/data/app/com.example.sati-1.apk]中由java.lang.ClassNotFoundException:com.example.sati.SplashAct引起的部分。它说找不到活动@com.example.sati.SplashAct
<activity
android:name=".SplashAct"
<activity
android:name=".Splash"