Android app ClassNotFoundException for main activity Android app ClassNotFoundException for main activity android android

Android app ClassNotFoundException for main activity


I had exactly the same problem. Suddenly my app stopped working. I didint make any change to manifest, but with some accident there was missing first row:

<?xml version="1.0" encoding="utf-8"?>

This caused ClassNotFoundException for launcher activity. I was struggling with that for few hours and I overlooked this every time I was checking manifest for possible mistake.

Strange thing happened after I have deleted this row again. Suprise, suprise app was still working. (and I didnt forget to rebuild app)

Hope this help someone to save few hours.


I get this error when my class isn't correctly defined in the manifest, typically because I haven't put in the correct name space as in:

    <activity android:name="com.company.project.main.MyMainActivity" ...>

as opposed to

    <activity android:name="MyMainActivity" ...>

Not sure why it would work for you on some devices and not others though.


Please close your eclipse and open. Clean your project and do a refresh. Then run and see.