【问题标题】:Android studio - build failed '/home/node/Android/Sdk/build-tools/23.0.2/aapt'' finished with non-zero exit value 1Android Studio - 构建失败'/home/node/Android/Sdk/build-tools/23.0.2/aapt''以非零退出值1完成
【发布时间】:2016-02-25 16:07:39
【问题描述】:

由于以下错误,我突然无法使用 Android Studio 构建我的项目。我附上了 build.gradle 文件和 SDK 安装图像,我尝试了几个小时但我无法解决。请帮我解决这个问题。

错误:

Error:Execution failed for task ':qApp:processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/home/node/Android/Sdk/build-tools/23.0.2/aapt'' finished with non-zero exit value 1

build.gradle 文件:

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.3.+'
    }
}

apply plugin: 'com.android.application'

android {
    useLibrary 'org.apache.http.legacy'
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "com.qapp"
        minSdkVersion 14
        targetSdkVersion 21
        multiDexEnabled true
    }

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


dependencies {
    compile project(':facebookSDK')
    compile project(':payPalDemo1')
    compile project(':uberLibrary')
    compile project(':bSLibrary')
    compile project(':pullToRefresh')
    compile project(':androidmapsutils')

    compile 'com.android.support:appcompat-v7:23.0.1'
    compile 'com.google.android.gms:play-services:+'
    compile 'com.android.support:multidex:1.0.0'
    compile files('libs/android-async-http-1.4.6.jar')
    compile files('libs/cardio.jar')
    compile files('libs/UserFormValidation.jar')
}

SDK 列表

【问题讨论】:

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


    【解决方案1】:

    尝试在你的 gradle 文件中添加这个:

    android {
        useLibrary 'org.apache.http.legacy'
        compileSdkVersion 23   
    ..... 
    
        dexOptions {
                javaMaxHeapSize "4g"
        }
    }
    

    【讨论】:

      【解决方案2】:

      尝试在您的依赖项中添加以下行:

      compile 'com.android.support:appcompat-v7:23.1.1'
      compile 'com.android.support:design:23.1.1'
      

      并且在 defaultConfig 中,使用与 compileSdkVersion

      相同的 targetSdkVersion

      【讨论】:

        猜你喜欢
        • 2015-11-03
        • 1970-01-01
        • 1970-01-01
        • 2016-09-30
        • 2018-10-17
        • 2016-01-30
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多