eclipse 未解析的 aapt 错误!

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9231289/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 17:41:57  来源:igfitidea点击:

Unparsed aapt error(s)!

androideclipseaapt

提问by PaulP

I'm working with Android in Eclipse and was trying to combine code from a template project I found into the skeleton project that Android creates when you start a new project. This is not an initial setup; have gotten several projects running and although I'm new to Android coding I have been working for several weeks without this problem so the environment is set up fine I think.

我正在 Eclipse 中使用 Android,并试图将我找到的模板项目中的代码合并到 Android 在您启动新项目时创建的骨架项目中。这不是初始设置;已经运行了几个项目,虽然我是 Android 编码的新手,但我已经工作了几个星期没有这个问题,所以我认为环境设置得很好。

The error I'm seeing is -

我看到的错误是 -

Unparsed aapt error(s)! Check the console for output

At one point I cleared the console messages and now even after closing the project and Eclipse, then reopening I get no console messages and none of my source or resource files are flagged.

有一次我清除了控制台消息,现在即使在关闭项目和 Eclipse 之后,然后重新打开,我也没有收到控制台消息,也没有标记我的源文件或资源文件。

What is aapt and where should I look for the source of this error? Thanks in advance for your help.

什么是 aapt,我应该在哪里查找此错误的来源?在此先感谢您的帮助。

回答by PaulP

I sorted this out. So for anyone else still on the learning curve with me, the solultion is as noted in my comment. In addition -

我解决了这个问题。因此,对于仍在与我一起学习的其他任何人,解决方案如我的评论中所述。此外 -

aapt = Android Asset Packaging Tool From the Developers Guide- "The Android Asset Packaging Tool (aapt) takes your application resource files, such as the AndroidManifest.xml file and the XML files for your Activities, and compiles them."

aapt = 来自开发人员指南的 Android 资产打包工具 - “Android 资产打包工具 (aapt) 获取您的应用程序资源文件,例如 AndroidManifest.xml 文件和您的活动的 XML 文件,并编译它们。”

The solution for me was simply to delete the error on the 'Problem' window (right click | delete). Then, force a rebuild by rerunning the app. Any remaining problems will now show up and be logged so you can track them down.

我的解决方案只是删除“问题”窗口上的错误(右键单击|删除)。然后,通过重新运行应用程序来强制重建。现在将显示并记录任何剩余的问题,以便您可以追踪它们。

Hope this is helpful to others.

希望这对其他人有帮助。

回答by Jeff Axelrod

This happened for me when I accidentally attempted to "run" an Android XML layout file. It created a file with the layout name and _out.xmlappended. I needed to delete that file before I could perform any further builds.

当我不小心尝试“运行”一个 Android XML 布局文件时,就发生了这种情况。它创建了一个带有布局名称并_out.xml附加的文件。在执行任何进一步的构建之前,我需要删除该文件。

回答by Jaime Montoya

This is what I did using Eclipse ADT, and that error disappeared:

这就是我使用 Eclipse ADT 所做的,该错误消失了:

Window > Preferences > Android > DDMS > Base local debugger port: 8600

Window > Preferences > Android > DDMS > Base local debugger port: 8600

I changed the value from 8600 to something else, example: 9999

我将值从 8600 更改为其他值,例如:9999

Finally, I went to Project > Clean... > Clean all projects > OK

最后,我去 Project > Clean... > Clean all projects > OK

The error disappeared.

错误消失了。

回答by Pedro Farias

May occur when the project is created (New Android) and Fields: minimum required SDK, Target SDK, compile with and Theme are not filled in correctly.

可能会在项目创建(新安卓)时出现,Fields: minimum required SDK, Target SDK, compile with 和 Theme 填写不正确。