Java.lang.RuntimeException: Unable To Instantiate Activity ComponentInfo/ ClassNotFoundException
Solution 1:
When upgrading, the 'Order and Export' of the new 'Android Private Libraries' is not always checked. And the android-support-v4.jar is now in this 'Android Private Libraries' section.
To fix this, go to 'Order and Export' and check 'Android Private Libraries'. Then refresh/clean/rebuild.
After you done this 'fix' for a library project, you may need to just close and re-open any depending project, because they may not see this 'fix' immediately.
Solution 2:
change your activity declaration in the manifest file into
<activity android:name=".UnlockActivity">
or else
<activity android:name="Yourcompletepackagename.UnlockActivity">
and try
Solution 3:
Dude, this also happened to me when my app was already published in the marketplace. It was a total disaster. I realized it after 5 hours of already publishing it.
There was no problem by running it with the ADT. Problem was with the generated APK. So if you publish an app, test the installation of the pure APK in your test phone.
As you, I also think that problem was with the the update of my ADT, in my case v22.
The solution was to clean and build the project:
Android java.lang.RuntimeException: Unable to instantiate activity ComponentInfo
Solution 4:
This can happen if your activity class is inside a default package. I fixed it by moving the activity class to a new package. and changing the manifest.xml
before
activity android:name=".MainActivity"
after
activity android:name="new_package.MainActivity"
Solution 5:
I had the same problem, but I had my activity declared in the Manifest file, with the correct name.
My problem was that I didn't have to imported a third party libraries in a "libs" folder, and I needed reference them in my proyect (Right-click, properties, Java Build Path, Libraries, Add Jar...).
About how do you declare an activity in the manifest file, is correct use .ActivityName always that activity be in the main package.
Post a Comment for "Java.lang.RuntimeException: Unable To Instantiate Activity ComponentInfo/ ClassNotFoundException"