Android的摇篮项目升级构建工具21.0.1:AAPT抛出异常 [英] Android Gradle Project upgrading build tools to 21.0.1: aapt throws Exception
问题描述
我们有一个Android摇篮工程。今天,我想从20 android的构建工具版本升级到21.0.1,但现在AAPT失败。
We have an android gradle project. Today I wanted to upgrade the android build tools version from 20 to 21.0.1, but now the aapt is failing.
* What went wrong:
Execution failed for task ':myproject-android:processDebugResources'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
c:\_DEVELOP\AndroidSDK\sdk\build-tools\21.0.1\aapt.exe package -f --no-crunch -I c:\_DEVELOP\AndroidSDK\sdk\platforms\android-16\android.jar -M D:\_MY_PROJECT\trunk\myproject_bin\gradle\build\re
lease\myproject-android\intermediates\manifests\full\debug\AndroidManifest.xml -S D:\_MY_PROJECT\trunk\myproject_bin\gradle\build\release\myproject-android\intermediates\res\debug -A D:\_MY_PROJECT\tr
unk\myproject_bin\gradle\build\release\myproject-android\intermediates\assets\debug -m -J D:\_MY_PROJECT\trunk\myproject_bin\gradle\build\release\myproject-android\generated\source\r\debug -F D:\_PIVOSC
ORE_P4\trunk\myproject_bin\gradle\build\release\myproject-android\intermediates\res\resources-debug.ap_ --debug-mode --custom-package com.myproject.app -0 apk --output-text-symbols D:\_MY_PROJECT\trunk\
myproject_bin\gradle\build\release\myproject-android\intermediates\symbols\debug
Error Code:
255
我有一些警告说:
I had some warnings saying:
libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
予定的那些,但也有6个,在appcompat-V7文库
I fixed those, but there are 6 more in the appcompat-v7 library.
如果我恢复了构建工具的版本20一切工作正常。
If I revert the build tools version to 20 everything works fine.
有没有人碰到这个问题?
Has anyone came across this problem?
推荐答案
这是由于一个错误的 AAPT
。有在21.0.0一个similer问题太多(错误code:-1073741819
)。您需要更新集结工具
再次进行修复。
This is caused by a faulty aapt
. There was a similer problem in 21.0.0 too (Error Code: -1073741819
). You need to update build-tools
again to fix it.
-
开放式的SDK管理器并安装
集结工具21.0.2
。
然后改变你的build.gradle,以便它看起来是这样的。
Then change your build.gradle so that it looks like this.
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.0.2"
替换版本号为必要时带最新的。的
这篇关于Android的摇篮项目升级构建工具21.0.1:AAPT抛出异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!