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

前端 未结 26 2523
暖寄归人
暖寄归人 2020-12-04 05:31

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 befo

26条回答
  •  無奈伤痛
    2020-12-04 06:06

    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.

提交回复
热议问题