Android 构建错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11804558/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Android build errors
提问by Jazzmine
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.
尝试在 Eclipse 中构建我的应用程序时出现这些错误。当编译器警告我我的 .project 文件丢失时,事情开始走下坡路。
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.
构建过程中发生错误。在项目“net.learn2develop.Layouts.LayoutsActivity”上运行构建器“Android Resource Manager”时出错。首选项节点“org.eclipse.jdt.core”已被删除。在项目 net.learn2develop.Layouts.LayoutsActivity 上运行构建器“Android 预编译器”时出错。路径必须包括项目和资源名称:/net.learn2develop.Layouts.LayoutsActivity Errors running builder 'Java Builder' on project 'net.learn2develop.Layouts.LayoutsActivity'。首选项节点“org.eclipse.jdt.core”已被删除。
I only have a red x at the top of my project, but not for any individual files within the project.
我的项目顶部只有一个红色的 x,但项目中的任何单个文件都没有。
Any advice on how to recreate my .project file or resolve these Preference node errors?
关于如何重新创建我的 .project 文件或解决这些首选项节点错误的任何建议?
I'm new to Android/Eclipse so details would be helpful.
我是 Android/Eclipse 的新手,所以详细信息会有所帮助。
Thanks
谢谢
回答by Alain Beauvois
Works for me : File -> Properties -> Java Compiler -> Configure Workspace Settings ...
对我有用:文件 -> 属性 -> Java 编译器 -> 配置工作区设置 ...
Then Restore Default, Apply and restart Eclipse.
然后恢复默认,应用并重新启动 Eclipse。
回答by Hayes Haugen
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...
通过从工作区中删除我的所有项目,然后重新导入它们,我能够修复这些非常烦人的错误。类似于 Jazzmine 的解决方案,但少了一步。现在等着看错误是否回来......
回答by Jazzmine
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.
我认为,通过创建一个新的工作区,将我的项目文件的副本移动到新的工作区,然后导入该项目,我解决了这个问题。不确定之前有多少文件被炸毁,但从头开始似乎可以解决它。
回答by sheelpriy
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.
基本问题是,当应用恢复默认值时,首选项代码正确地发现节点中没有剩余的项目特定设置,因此它删除了节点。但是 WorkingCopyPreferences 从来没有发现这个事实,所以从那时起一个定时炸弹正在滴答作响。
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.
请注意,由于 JDT 选项页面都共享一个 WorkingCopyManager,但每个页面仅修改 jdt.core 设置的一个子集,因此任何单个页面都无法判断恢复该页面设置的默认值是否会导致节点即将被删除。所以它不能,例如,巧妙地调用 WorkingCopyManager 上的 removeNode()。
回答by Parthasarathy Deva
Delete the project from the workspace and checkout again and configure the project... Its working for me in when I checkout from the SVN.
从工作区中删除项目并再次签出并配置项目......当我从SVN签出时它对我有用。