Android: Activity not registered in the manifest

otter-in-a-suit picture otter-in-a-suit · Mar 24, 2012 · Viewed 16.3k times · Source
<uses-sdk android:minSdkVersion="7" />

<application
    android:description="@string/app_description"
    android:icon="@drawable/icon"
    android:label="@string/app_name"
    android:theme="@android:style/Theme.Light" >
    <activity
        android:name="com.xyz.Main.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>

And the Lint-tool tells me that my activity isn't registered in the manifest and if I try to run it, LogCat kindly tells me:

java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.name/com.xyz.Main.MainActivity}: java.lang.ClassNotFoundException: com.xyz.Main.MainActivity

This is driving me nuts, I've re-installed Eclipse as well as updated the SDK and stuff to API-level 17 and now I seem to be unable to execute my very own app. I've got absolutely no idea what the hell's wrong here, apparently the activity is perfectly well registered within the manifest.xml.

Thanks in advance.

Answer

soren.qvist picture soren.qvist · Mar 24, 2012

Your package name contains a capital letter ("Main"), that might be a problem. Check out this issue on code.google.com:

http://code.google.com/p/android/issues/detail?id=27529