Most of the devices can run my app but I got this error report :
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.company.app/com
I ran into this problem and it was fixed using this.
I had not checked one external library under "Order and export" and i was getting the error.
None of the answers above worked for me, contributing my solution if it's going to spare some hours to anyone in the future.
What apparently worked for me was removing an extra support lib v4 jar in my project.
After I updated the support lib via android tools, I had to fix jar mismatches in many libraries I use and point them all to the same jar in the android-sdks folder.
I accidently added it to my project as well, and for some reason it made my MainActivity class not found in runtime, because the jar was also in the android-support-v7-appcompat library I was using.
No errors on eclipse at all.
I removed the jar from my project, and checked the jar in the v7 appcompat library in the export tab so it would be available to my project as well, and voila, app is working.
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.
In eclipse, check Properties>Java Build Path>Source and see if the output folder is always the default (/bin/classes).
For me, this was an issue because of the maven plugin: whenever I right click>Maven>Update Project...>Ok, it changes the output folder of the src folder to target/classes, causing the ClassNotFoundException.
I made a copy/paste of the following folders to a new project, keeping the same package name, and solved it:
And finally I added the file dependencies build.gradle
.
GL
Please close your eclipse and open. Clean your project and do a refresh. Then run and see.