Reputation: 4007
It seams that I missing the R file, this is a common error and usually I have solved by cleaning the projects, using android tools fix project properties and restarting eclipse. Now I have installed the new android developer tools eclipse and after importing the project I have this error in eclipse:
Errors occurred during the build.
Errors running builder 'Android Pre Compiler' on project 'MyProject'.
java.lang.NullPointerException
and the R file is not generated so it is missing. The project is a library project. Thanks
Upvotes: 0
Views: 222
Reputation: 435
Clean the project because the project may have trouble finding the name of a resources, it really sucks that i constantly have this problem when adding new image..
Upvotes: 0
Reputation: 7752
Sometimes if you have errors in an XML file, it will stop the project from building correctly and the resources (project.R) file won't be created properly. You will also need to make sure that you are importing your resource file and not the one from android.R
If you've changed the project build target or minSdkVersion, you might have XML nodes in one of your layout files that isn't supported by the SDK you are using which will stop it from building. That's also worth checking
Upvotes: 1
Reputation: 317
Go to Project and hit Clean. This should regenerate your R.java file. Also get rid of any import android.R.* statements and then do the clean up as mentioned.
Otherwise, XML resource under layout may not having the correct naming convention or might be having some capital letters.
Try changing them to lowercase and make sure your layout.xml files don't contains errors.
Upvotes: 0