aapt 错误 138 processDebugResources [英] aapt error 138 processDebugResources

查看:44
本文介绍了aapt 错误 138 processDebugResources的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

今天在构建/制作项目时遇到了这个令人沮丧的错误,这似乎是因为使用构建工具 19.0.1、19.0.2 和 19.0.3 安装了 Android SDK 22.6(也尝试过 22.6.1).aapt 错误导致无法生成 R.java.

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.

我认为这是与项目相关的事情,因为我有另一个构建正常的项目.我尝试清理项目/工作区、新工作区、重新安装 Eclipse 和 Android SDK,然后移植到 Android Studio gradle,这是我在下面包含的错误.

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.

我也将项目恢复到以前有效的提交

有人遇到过这种事情吗?通常是干净的作品,但这次不是.

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

推荐答案

这是 AAPT 中的一个错误,当它看到对不存在资源的引用时会崩溃.不幸的是,它需要您仔细检查资源文件以尝试发现错误,因为它往往不会为您提供有用的信息.

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.

这写在 https://code.google.com/p/android/issue/detail?id=61308,如果您查看那里,您会发现其他用户为解决崩溃而修复的示例.

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.

这篇关于aapt 错误 138 processDebugResources的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆