Issue
I have created sample android project in Eclipse, but while excuting i am getting an Error: Activity class {com.example.best/com.example.best.MainActivity} does not exist.
but MainActivity class exist in project
package com.example.best;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
}
Following is the error message printed on the console
[2015-03-01 22:01:58 - best] Starting activity com.example.best.MainActivity on device EAAZCY30C637
[2015-03-01 22:01:59 - best] New package not yet registered with the system. Waiting 3 seconds before next attempt.
[2015-03-01 22:02:02 - best] Starting activity com.example.best.MainActivity on device EAAZCY30C637
[2015-03-01 22:02:02 - best] New package not yet registered with the system. Waiting 3 seconds before next attempt.
[2015-03-01 22:02:05 - best] Starting activity com.example.best.MainActivity on device EAAZCY30C637
[2015-03-01 22:02:05 - best] New package not yet registered with the system. Waiting 3 seconds before next attempt.
[2015-03-01 22:02:08 - best] Starting activity com.example.best.MainActivity on device EAAZCY30C637
[2015-03-01 22:02:08 - best] New package not yet registered with the system. Waiting 3 seconds before next attempt.
[2015-03-01 22:02:11 - best] Starting activity com.example.best.MainActivity on device EAAZCY30C637
[2015-03-01 22:02:12 - best] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.best/.MainActivity }
[2015-03-01 22:02:12 - best] ActivityManager: Error type 3
[2015-03-01 22:02:12 - best] ActivityManager: Error: Activity class {com.example.best/com.example.best.MainActivity} does not exist.
Here is the content of my manifest file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.best"
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" >
<activity
android:name="com.example.best.MainActivity"
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>
</manifest>
what should i do for resolve this problem
Solution
There is no error in your sample. I have tested it om my machine and it is working properly.
Please try following procedure. Project --> Clean
If it does not work then try creating new workspace.
Answered By - Atish Bundhe
Answer Checked By - David Marino (JavaFixing Volunteer)