Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Your project contains error(s), please fix it before running it

That usually comes from errors in the build path.

If you're using eclipse, there is a view you can add that lists all the errors called "Problems":

enter image description here

Otherwise, you can try to clean the project, and that usually solves a few problems.

Finally, if you add or alter resources from outside your IDE, you'll want to reload the resources and clean.

EDIT (Comment by anonymous user)

This can also be caused by an out of date "Debug Certificate" fixed as follows:

IF ALL FAILS THEN THIS GOTTA BE THE SOLUTION:

Delete your debug certificate under ~/.android/debug.keystore (on Linux and Mac OS X); the directory is something like %USERPROFILE%/.androidon Windows.

The Eclipse plugin should then generate a new certificate when you next try to build a debug package. You may need to clean and then build to generate the certificate.

This is also another fix for the "setContentView(R.layout.main);" error that says it cannot find R.layout.main when it is actually generated. (R cannot be resolved to a variable).

This is also another fix for the error "Your project has errors..." and you cannot find any. Clean and rebuild are still necessary after generating a new debug certificate.


First go to Window -> Show View -> Error Logs in menu. It will display error logs if you have any. Then try to clean the project and build it again.


Well, in my case some libraries were addressed twice in the:

Project >> Properties >> Java Build Path >> Libraries

I just had to remove the duplicate and it worked fine without any cleanings or refreshing.


I saw this with an existing project. I had made a few edits, but hadn't imported anything new. Restarting Eclipse didn't help.

Project->Clean did solve the problem.


I come across this error often when I import a new project in my workspace.

Reason: Some necessary files (Like R.Java) is not generated in its respective packages.

Cure: Clean and build projects, All the files that needs to be auto generated will be there on place after building the project.

Best Luck.