【问题标题】:Android/Sdk/build-tools/22.0.1/aapt'' finished with non-zero exit value 1Android/Sdk/build-tools/22.0.1/aapt'' 以非零退出值 1 结束
【发布时间】:2015-11-03 19:25:11
【问题描述】:

我的项目中遇到了这个问题,我已经尝试了这篇文章中的解决方案: Post 1 Post 2,但对我不起作用。该项目在1.2版本的Android Studio上完美运行,当我升级到1.3版本时问题就开始了

这是我的 build.gradle 文件

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {

        classpath 'com.android.tools.build:gradle:1.3.0'

        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.6'
    }
}

repositories {
    mavenCentral()
    mavenLocal()
}

apply plugin: 'com.android.application'
apply plugin: 'android-apt'

android {
    compileSdkVersion 22
    buildToolsVersion '22.0.1'

    defaultConfig {
        applicationId "br.appname"
        minSdkVersion 11
        targetSdkVersion 22
    }

    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
        }
    }
}

apt {
    arguments {
        resourcePackageName android.defaultConfig.applicationId
        androidManifestFile variant.outputs[0].processResources.manifestFile
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])

    apt "org.androidannotations:androidannotations:3.3.2"

    compile 'org.androidannotations:androidannotations-api:3.3.2'
    compile 'com.google.code.gson:gson:2.2.4'
    compile 'com.google.android:support-v4:r7'
    compile 'com.loopj.android:android-async-http:1.4.8'
    compile 'commons-lang:commons-lang:2.6'
    compile 'com.crittercism:crittercism-android-agent:5.2.0'
    compile 'com.j256.ormlite:ormlite-android:4.48'
    compile 'com.j256.ormlite:ormlite-core:4.48'
    compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.4'

    compile files('libs/android-smart-image-view-1.0.0.jar')
    compile files('libs/libGoogleAnalyticsServices.jar')

    compile 'com.android.support:support-v4:21.0.0'
    compile "com.android.support:appcompat-v7:21.0.0"


}

完整的错误是这样的:

错误:任务 ':appName:processDebugResources' 执行失败。 com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException:进程'命令 '/home/user/Android/Sdk/build-tools/22.0.1/aapt'' 完成 非零退出值 1

在 gradle 控制台我有这个错误:

:appName:processDebugResources

AGPBI: {“种类”:“简单”,“文本”:“/home/user/Desktop/projects/UMobile/trunk/uniforMobile/build/intermediates/res/merged/debug/mipmap-xhdpi-v4/ic_launcher.png: 错误:文件重复。","来源":[{}]}

AGPBI: {“种类”:“简单”,“文本”:“/home/user/Desktop/projects/UMobile/trunk/uniforMobile/build/intermediates/res/merged/debug/mipmap-xhdpi/ic_launcher.png: 原文在这里。版本限定符可能是 暗示。","来源":[{}]}

我该如何解决这个问题?

【问题讨论】:

    标签: android android-studio gradle android-gradle-plugin build.gradle


    【解决方案1】:

    问题解决了!

    我只是在末尾用 -v4 重命名了 mipmap 文件夹。

    【讨论】:

    • 干得好,但你是怎么做到的?例如,还有其他答案可以链接吗?人们可以从中获得有关该问题的更多信息。
    【解决方案2】:

    这已经晚了,但就我而言,我删除了一张仍在使用的图片。重新添加并刷新 gradle 后一切正常

    【讨论】:

    • 虽然此链接可能会回答问题,但最好在此处包含答案的基本部分并提供链接以供参考。如果链接页面发生更改,仅链接答案可能会失效。 - From Review
    • @MauricioWanderleyMartins 什么链接?
    猜你喜欢
    • 2018-10-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-09-03
    • 1970-01-01
    • 2016-07-14
    相关资源
    最近更新 更多