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

I am developing a simple Android application. But when I run Eclipse, it shows the following error:

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

I can't find any error in my project or there is no error in my application. There is a red cross under the application name but it is not under another file name.

Does anyone else have this issue?


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":

在这里输入图像描述

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%/.android on 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.

链接地址: http://www.djcxy.com/p/91328.html

上一篇: 我不记得我的android debug.keystore密码

下一篇: 您的项目包含错误,请在运行之前对其进行修复