AAPT错误138 processDebugResources错误、AAPT、processDebugResources

由网友(湗鎖★記憶♂)分享简介:冉在这个令人沮丧的错误今天建筑/制作项目时,这似乎是因为安装Android SDK中22.6使用构建工具19.0.1,19.0.2和19.0.3(曾尝试过22.6.1)。所述AAPT错误导致R.java不能生成我还以为是什么项目相关的,因为我有另外一个项目,建立正常。我试过清洗工程/工作区,新的工作空间,重新安装Ecl...

冉在这个令人沮丧的错误今天建筑/制作项目时,这似乎是因为安装Android SDK中22.6使用构建工具19.0.1,19.0.2和19.0.3(曾尝试过22.6.1)。所述AAPT错误导致R.java不能生成

我还以为是什么项目相关的,因为我有另外一个项目,建立正常。我试过清洗工程/工作区,新的工作空间,重新安装Eclipse和Android SDK中,然后移植到Android工作室的摇篮是我已经包含下面的错误。

编辑:我也恢复项目,previous提交的工作

任何人都跑了,以这种事情?通常一个干净的作品,但不是这一次。

 错误:未能执行任务:MyApp的:processDebugResources。
> com.android.ide.common.internal.LoggedErrorException:无法运行命令:
    /Users/scottab/dev/adt-bundle-mac-x86_64/sdk/build-tools/19.0.3/aapt包-f --no-紧缩-I /用户/ scottab的/ dev / ADT-束-MAC-x86_64的/sdk/platforms/android-19/android.jar -M /Users/MyApp/build/manifests/debug/AndroidManifest.xml -S /用户/ MyApp的/建设/ RES /所有/调试-A /用户/ MyApp的/编译/资产/调试-m -J /用户/ MyApp的/编译/来源/ R /调试-F /Users/MyApp/build/libs/MyApp-debug.ap_ --debug模式--custom包com.myapp。 --output的android-文本符号/用户/ MyApp的/编译/符号/调试
  错误code:
    138
 

解决方案

这是AAPT,它崩溃,当它看到的引用不存在的资源的错误。不幸的是,它需要你通过你的资源文件,试图发现错误,因为它往往不给你有用的信息。

这是写在https://$c$c.google.com/p/android/issues/detail?id=61308如果你有,你会发现什么其他用户有固定的解决了崩溃的例子。

Ran in to this frustrating error today when building/making project, this seems to be since installing Android SDK 22.6 (have tried the 22.6.1 too) using build tools 19.0.1,19.0.2 and 19.0.3. The aapt error is causing R.java not to be generated.

I thought it was something project related as I have another project that builds ok. I've tried cleaning project/workspace, new workspace, reinstall Eclipse and Android SDK, then ported to Android studio gradle which is the error I've included below.

Edit: I also reverted project to previous commit that worked

Anyone ran in to this kind of thing? normally a clean works but not this time.

Error:Execution failed for task ':MyApp:processDebugResources'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
    /Users/scottab/dev/adt-bundle-mac-x86_64/sdk/build-tools/19.0.3/aapt package -f --no-crunch -I /Users/scottab/dev/adt-bundle-mac-x86_64/sdk/platforms/android-19/android.jar -M /Users/MyApp/build/manifests/debug/AndroidManifest.xml -S /Users/MyApp/build/res/all/debug -A /Users/MyApp/build/assets/debug -m -J /Users/MyApp/build/source/r/debug -F /Users/MyApp/build/libs/MyApp-debug.ap_ --debug-mode --custom-package com.myapp.android --output-text-symbols /Users/MyApp/build/symbols/debug
  Error Code:
    138

解决方案

This is a bug in AAPT, where it crashes when it sees a reference to a nonexistent resource. Unfortunately, it requires you to go through your resource files to try to spot the error, as it tends to not give you useful information.

This is written up in https://code.google.com/p/android/issues/detail?id=61308 and if you look there you'll find examples of what other users have fixed to solve the crash.

阅读全文

相关推荐

最新文章