构建Android项目时出错。 “AAPT流程尚未准备好接收命令”

时间:2017-06-29 04:16:25

标签: android android-studio gradle android-gradle

我正在使用 Ubuntu 14.04 32位操作系统。我将Android Studio 2.2.2更新为2.3.3,升级后无法构建我的项目。当我尝试构建我的项目时,Android Studio始终显示错误,如

 Error:java.util.concurrent.ExecutionException: java.lang.RuntimeException: AAPT process not ready to receive commands
 Error:Execution failed for task ':app:mergeDebugResources'.
 > Error: java.util.concurrent.ExecutionException: java.lang.RuntimeException: AAPT process not ready to receive commands

这是我的 build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion '25.0.0'
    aaptOptions.cruncherEnabled = false
    aaptOptions.useNewCruncher = false
    defaultConfig {
        applicationId "akhil.com.d4donline"
        minSdkVersion 15
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'com.wdullaer:materialdatetimepicker:2.3.0'
    compile 'com.mcxiaoke.volley:library-aar:1.0.0'
    compile 'com.android.support:cardview-v7:25.3.0'
    compile 'com.android.support:design:25.3.1'

    testCompile 'junit:junit:4.12'
}

1 个答案:

答案 0 :(得分:0)

这是Linux中一个众所周知的错误,只需将构建版本降级为23:

android {
compileSdkVersion 23
buildToolsVersion '23.0.3'

. . .

defaultConfig {
    . . .

    targetSdkVersion 23

    . . .

您可能还需要将 gradle版本更改为2.2