上找到類,模擬器告訴我,它不幸已停止。我以前有過同樣的錯誤,然後我修復了它,但添加了飛濺活動後,我又遇到了這個問題。引起:java.lang.ClassNotFoundException:在啓動我的應用程序後沒有在路徑
03-24 15:14:21.180: E/AndroidRuntime(857): FATAL EXCEPTION: main
03-24 15:14:21.180: E/AndroidRuntime(857): Process: com.gosha.bux, PID: 857
03-24 15:14:21.180: E/AndroidRuntime(857): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.gosha.bux/com.gosha.bux.perv}: java.lang.ClassNotFoundException: Didn't find class "com.gosha.bux.perv" on path: DexPathList[[zip file "/data/app/com.gosha.bux-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.gosha.bux-2, /system/lib]]
03-24 15:14:21.180: E/AndroidRuntime(857): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2121)
03-24 15:14:21.180: E/AndroidRuntime(857): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
03-24 15:14:21.180: E/AndroidRuntime(857): at android.app.ActivityThread.access$800(ActivityThread.java:135)
03-24 15:14:21.180: E/AndroidRuntime(857): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
03-24 15:14:21.180: E/AndroidRuntime(857): at android.os.Handler.dispatchMessage(Handler.java:102)
03-24 15:14:21.180: E/AndroidRuntime(857): at android.os.Looper.loop(Looper.java:136)
03-24 15:14:21.180: E/AndroidRuntime(857): at android.app.ActivityThread.main(ActivityThread.java:5017)
03-24 15:14:21.180: E/AndroidRuntime(857): at java.lang.reflect.Method.invokeNative(Native Method)
03-24 15:14:21.180: E/AndroidRuntime(857): at java.lang.reflect.Method.invoke(Method.java:515)
03-24 15:14:21.180: E/AndroidRuntime(857): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
03-24 15:14:21.180: E/AndroidRuntime(857): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
03-24 15:14:21.180: E/AndroidRuntime(857): at dalvik.system.NativeStart.main(Native Method)
03-24 15:14:21.180: E/AndroidRuntime(857): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.gosha.bux.perv" on path: DexPathList[[zip file "/data/app/com.gosha.bux-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.gosha.bux-2, /system/lib]]
03-24 15:14:21.180: E/AndroidRuntime(857): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
03-24 15:14:21.180: E/AndroidRuntime(857): at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
03-24 15:14:21.180: E/AndroidRuntime(857): at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
03-24 15:14:21.180: E/AndroidRuntime(857): at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
03-24 15:14:21.180: E/AndroidRuntime(857): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2112)
03-24 15:14:21.180: E/AndroidRuntime(857): ... 11 more
03-24 15:14:43.061: I/Process(857): Sending signal. PID: 857 SIG: 9
清單
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.gosha.bux"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="18" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme"
android:debuggable="true"
>
<activity
android:name="com.gosha.bux.perv"
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="com.gosha.bux.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="com.gosha.bux.MAINACTIVITY" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
飛濺活動
public class perv extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(com.gosha.bux.R.layout.pervy);
Thread timer = new Thread(){
public void run(){
try{
sleep(5000);
}
catch (InterruptedException e){
e.printStackTrace();
}
finally {
Intent openMainActivity = new Intent("com.gosha.bux.MAINACTIVITY");
startActivity(openMainActivity);
}
}
};
}
}
你正在做的包名的錯誤或manifest.xml的 – Android
賺不到目標的活動進入
extends MultiDexApplication
添加此清潔你的應用程序/項目 –
你有答案嗎?因爲現在我也面臨同樣的問題... –