Android build errors

2019-02-24 03:24发布

问题:

I'm getting these errors when trying to build my app in Eclipse. Things started going downhill when the compiler warned me that my .project file was missing.

Then I tried to fix the project and now am getting these errors:

Errors occurred during the build. Errors running builder 'Android Resource Manager' on project 'net.learn2develop.Layouts.LayoutsActivity'. Preference node "org.eclipse.jdt.core" has been removed. Errors running builder 'Android Pre Compiler' on project net.learn2develop.Layouts.LayoutsActivity'. Path must include project and resource name: /net.learn2develop.Layouts.LayoutsActivity Errors running builder 'Java Builder' on project 'net.learn2develop.Layouts.LayoutsActivity'. Preference node "org.eclipse.jdt.core" has been removed.

I only have a red x at the top of my project, but not for any individual files within the project.

Any advice on how to recreate my .project file or resolve these Preference node errors?

I'm new to Android/Eclipse so details would be helpful.

Thanks

回答1:

Works for me : File -> Properties -> Java Compiler -> Configure Workspace Settings ...

Then Restore Default, Apply and restart Eclipse.



回答2:

I was able to fix these very annoying errors by deleting all my projects out of the workspace and then reimporting them. Similar to Jazzmine's solution but one less step. Now waiting to see if the errors come back...



回答3:

I solved the problem, I think, by creating a new workspace, moving a copy of my project files into the new workspace and then importing the project. Not sure how so many files got blown away before but starting from scratch seemed to take care of it.



回答4:

The basic problem is that when the Restore Defaults was applied, the Preferences code correctly discovered that there were no project-specific settings remaining in the node, so it removed the node. But WorkingCopyPreferences never discovers that fact, so a timebomb is ticking from then on.

Notice that since the JDT options pages all share a WorkingCopyManager, but each page only modifies a subset of the jdt.core settings, there is no way that any single page can tell whether restoring defaults for that page's settings will or will not cause the node to be removed. So it can't, e.g., cleverly call removeNode() on the WorkingCopyManager.



回答5:

Delete the project from the workspace and checkout again and configure the project... Its working for me in when I checkout from the SVN.