【问题标题】:How do I go about troubleshooting this ANT aapt error (null returns 255)我该如何解决这个 ANT aapt 错误(null 返回 255)
【发布时间】:2014-07-28 23:31:22
【问题描述】:

我对 ant 和 Team City 还很陌生,但在过去的几个月里已经建立并运行了一些构建,但是昨天刚刚开始失败,而我在中间的大部分时间里完全没有明白了。

该应用程序是在 Eclipse 中构建的 Java Android 应用程序(构建良好),然后上传到 svn,由 Team City 监控。

我的构建日志的相关部分如下。

[09:15:13][Step 4/5] -code-gen (1s)
[09:15:13][-code-gen] mergemanifest
[09:15:13][-code-gen] do-only-if-manifest-hasCode (1s)
[do-only-if-manifest-hasCode] sequential (1s)
[09:15:13][sequential] if (1s)
[09:15:13][if] echo
[09:15:13]Handling aidl files...
[09:15:13][if] aidl
[09:15:13]No AIDL files to compile.
[09:15:13][if] echo
[09:15:13]----------
[09:15:13][if] echo
[09:15:13]Handling RenderScript files...
[09:15:13][if] echo
[09:15:13]----------
[09:15:13][if] echo
[09:15:13]Handling Resources...
[09:15:13][if] aapt (1s)
[09:15:13][aapt] Generating resource IDs...
[09:15:14][aapt] null returned: 255 
[do-only-if-manifest-hasCode] The following error occurred while executing this line:
C:\adt-bundle-windows\sdk\tools\ant\build.xml:698: null returned: 255

之前的构建步骤执行ant clean,这似乎是此类问题的通用修复所有答案。

此签入确实添加了一个新的字符串值和 ui 项引用,但没有任何异常,并且代码已正确签入。

我能找到的关于错误 255 的极少数引用是一个通用的“发生了不好的事情”错误。

谁能提供一些关于我如何解决(或最好修复)这个特定构建错误的指示。

【问题讨论】:

    标签: android ant aapt


    【解决方案1】:

    经过大量工作,大部分都围绕proguard.txt,即第 698 行所指的内容,我意识到这是一条红鲱鱼。 Proguard.txt 只是 aapt 被传递的最后一个参数,而出现问题的是 aapt

    检查错误上方的行,我发现了我要查找的内容。

    事实上,我的strings.xml 文件在签入时已损坏(我不确定这是怎么发生的),这导致构建失败[aapt] Generating resource IDs... 步骤。

    我重新检查了string.xml,构建运行良好。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-07-21
      • 2016-09-09
      • 2015-02-28
      • 2013-08-16
      • 2020-04-17
      相关资源
      最近更新 更多