在 ADT 上运行构建器“Android 资源管理器”时出错
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20043521/
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
Errors running builder 'Android Resource Manager' on ADT
提问by Mohammod Hossain
I am facing a problem when I try to create new android project in eclipse adt plugin tools.
当我尝试在 eclipse adt 插件工具中创建新的 android 项目时遇到问题。
ERROR/EXCEPTION::
错误/异常::
Errors occurred during the build.
Errors running builder 'Android Resource Manager' on project 'test'.
java.lang.NullPointerException
Errors occurred during the build.
Errors running builder 'Android Resource Manager' on project 'test'.
java.lang.NullPointerException
I have faced this problem two times previously. Only solution was to re-install Windows operating system which actually did solve the problem. But I want a real solution without re-installing Windows.
我以前遇到过两次这个问题。唯一的解决方案是重新安装 Windows 操作系统,这确实解决了问题。但我想要一个真正的解决方案,而无需重新安装 Windows。
回答by DoronK
Switching to a new workspace worked for me.
切换到新工作区对我有用。
File-> Switch Workspace.
文件-> 切换工作区。
回答by Andre Coetzee
found a better solution. in the create project wizard. don't create an activity in the wizard. just untick create an activity and just create the activity manually in the manifest.
找到了更好的解决方案。在创建项目向导中。不要在向导中创建活动。只需取消创建活动并在清单中手动创建活动即可。
回答by kaala
I guess you upgrade your java to java7u55.
我猜你将你的java升级到java7u55。
because I am using mac, but, FYI
因为我使用的是 mac,但是,仅供参考
I solve this by edit eclipse.ini, force the ide to use java 1.6
我通过编辑 eclipse.ini 解决了这个问题,强制 ide 使用 java 1.6
-vm
/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Commands/java
-vm
/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Commands/java
you could try the same.
你也可以试试。
回答by Hatchmaster J
In my case, the error was solved by changing the workspace folder permissions with chmod 777.
就我而言,该错误是通过使用 chmod 777 更改工作区文件夹权限来解决的。
I am using Mac OS X and downloaded the ADT bundle for Mac.
我正在使用 Mac OS X 并下载了适用于 Mac 的 ADT 包。
回答by BumpBitcoin
If you close eclipse and then look in your system processes and still see adb running, then that's the problem - it crashed. In my case it was because I have extension files for other programs in my JRE that the adb doesn't seem to like. Remove all your ext files, force shut down your adb.exe and then restart eclipse.
如果您关闭 eclipse 然后查看您的系统进程并且仍然看到 adb 正在运行,那么这就是问题所在 - 它崩溃了。就我而言,这是因为我的 JRE 中有其他程序的扩展文件,而 adb 似乎并不喜欢。删除所有 ext 文件,强制关闭 adb.exe,然后重新启动 eclipse。
Root exception:
根异常:
java.lang.NoClassDefFoundError: org/apache/log4j/Priority
回答by 18446744073709551615
Usually this means that they have one more time introduced a bug.
通常这意味着他们还有一次引入错误。
The "magic passes" that may help or not help are:
可能有帮助或没有帮助的“魔术通行证”是:
- Pressing F5 (refresh)
- Updating Android, Eclipse and ADT (knowing that you do have such a problem, I myself definitely will not do any such updates in the near future)
- Creating a project from the command line, building it and trying to import
- If you have any project that already works, you may try to take files from that project.
- Read the logs,they are usually more informative than just the last 30 lines, but on Windows you will have to either configure the screen buffer height to be about 300-600, or redirect the output to a file.
- Clean and build again.
- 按F5(刷新)
- 更新Android、Eclipse和ADT(知道你确实有这样的问题,我自己近期绝对不会做这样的更新)
- 从命令行创建项目,构建它并尝试导入
- 如果您有任何已经运行的项目,您可以尝试从该项目中获取文件。
- 阅读日志,它们通常比最后 30 行提供更多信息,但在 Windows 上,您必须将屏幕缓冲区高度配置为大约 300-600,或者将输出重定向到文件。
- 清洁并重新构建。
回答by Boardy
You usually get this after an SDK/ADT update.
您通常会在 SDK/ADT 更新后获得此信息。
Go to your SDK manager and ensure that there are no updates. Then in Eclipse go to Help > Check for Updates and install any updates it finds.
转到您的 SDK 管理器并确保没有更新。然后在 Eclipse 中转到 Help > Check for Updates 并安装它找到的任何更新。
Restart eclipse and hopefully it should all work.
重新启动 eclipse,希望它一切正常。
Failing that uninstall Eclipse and re-install Eclipse and the plugins again should fix it as well, no need to re-install your whole PC.
如果没有卸载 Eclipse 并重新安装 Eclipse,插件也应该修复它,无需重新安装整个 PC。
回答by user1050755
I use maven to build and integrate android projects with jenkins/netbeans. For editing android resources, I often use Eclipse because of the ADT plugin and better android resources support.
我使用 maven 来构建和集成 android 项目与 jenkins/netbeans。对于编辑android资源,我经常使用Eclipse,因为有ADT插件和更好的android资源支持。
Eclipse (Kepler) has serious problems when you import maven-based android projects. It expects the project.properties file in the root folder and will NOT generate it on its own no matter what. Example content:
当您导入基于 maven 的 android 项目时,Eclipse (Kepler) 有严重的问题。它需要根文件夹中的 project.properties 文件,无论如何都不会自行生成它。示例内容:
# this file is needed by eclipse (adt plugin).
# Project target.
target=Google Inc.:Google APIs x86:19
Additionally, create a sym link called "gen" pointing to target/generated-sources/r if using maven to build the android project on the command line. That way, you should be able to do "File->Import...->Existing Android Project". You get an error message, but it didn't matter in my case.
此外,如果使用 maven 在命令行上构建 android 项目,请创建一个名为“gen”的符号链接,指向 target/generated-sources/r。这样,您应该能够执行“File->Import...->Existing Android Project”。您收到一条错误消息,但对我而言这无关紧要。
Additional hints in case you have problems with m2e-android plugin:
如果您在使用 m2e-android 插件时遇到问题,请提供其他提示:
- always check that the output folders for source dirs and resource dirs are correct.
- check that source dirs are set as source dirs (you usually get a corresponding warning)
- if resources from dependencies are not included in the final apk, check the filter settings for your resource dirs
- you may need to "import maven project from existing sources" before importing it as android project from existing sources.
- make sure dependencies are imported into the workspace and open and referenced (project props -> android -> add lib)
- eclipse adt does not support aar libs, use apklib instead
- 始终检查源目录和资源目录的输出文件夹是否正确。
- 检查源目录是否设置为源目录(您通常会收到相应的警告)
- 如果来自依赖项的资源未包含在最终 apk 中,请检查资源目录的过滤器设置
- 在将其作为 android 项目从现有源导入之前,您可能需要“从现有源导入 Maven 项目”。
- 确保将依赖项导入工作区并打开和引用(项目道具 -> android -> 添加 lib)
- eclipse adt 不支持 aar 库,请改用 apklib
回答by 0014
I have several projects in my folder. Every time I start a new one I close the others. I got this error because appcompat_v7 was closed.
我的文件夹中有几个项目。每次我开始一个新的时,我都会关闭其他的。我收到此错误是因为 appcompat_v7 已关闭。
- Right click on
appcompat_v7
and select Open Project.
- 右键单击
appcompat_v7
并选择Open Project。
This solved my problem.
这解决了我的问题。
回答by Joey
Solved after changing a setting in eclipse.ini
. I am using OS X 10.11.4
and Eclipse Mars 4.5.2
.
更改设置后解决eclipse.ini
。我正在使用OS X 10.11.4
和Eclipse Mars 4.5.2
。
- Go to the folder of
Eclipse.app
in Finder. - Right click to open a menu, and click
Show Package Contents
. - Go to
/Contents/Eclipse
. - Open
eclipse.ini
in your favorite text editor. change -vmpath like below:
BEFORE: /Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/jre/bin
AFTER: /Library/Java/JavaVirtualMachines/jdk1.8.0_73.jdk/Contents/Home/jre/bin
reopen Eclipse.
- enjoy :D
- 转到
Eclipse.app
Finder 中的文件夹。 - 右键单击打开菜单,然后单击
Show Package Contents
。 - 去
/Contents/Eclipse
。 eclipse.ini
在您喜欢的文本编辑器中打开。更改-vm路径,如下所示:
BEFORE:/图书馆/的Java / JavaVirtualMachines / jdk1.7.0_79.jdk/内容/首页/ JRE /箱
AFTER:/图书馆/的Java / JavaVirtualMachines / jdk1.8.0_73.jdk/内容/首页/ JRE /箱
重新打开 Eclipse。
- 享受:D