Execution failed for task ':app:compileDebugAi

2019-01-02 15:42发布

I installed Android Studio on my computer. I created a new project but that got me the error below. What can I do?

Error:Execution failed for task ':app:compileDebugAidl'.
> aidl is missing

My Android Studio version is 1.1.0.

This is my build.gradle file:

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.1.0'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}
allprojects {
    repositories {
        jcenter()
    }
}

And :

apply plugin: 'com.android.application'

android {
    compileSdkVersion 21
    buildToolsVersion "24.1.2"

    defaultConfig {
        applicationId "com.example.jo.cloning_a_login_screen"
        minSdkVersion 13
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:22.0.0'
}

14条回答
墨雨无痕
2楼-- · 2019-01-02 16:24

I was able to get build to work with Build Tools 23.0.0 rc1 if I also opened the project level build.gradle file and set the version of the android build plugin to 1.3.0-beta1. Also, I'm tracking the canary and preview builds and just updated a few seconds before, so perhaps that helped.

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.3.0-beta1'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}
查看更多
只若初见
3楼-- · 2019-01-02 16:25

Essentially Matt Daley/Johnny Mohseni's solution worked for me.

I faced exactly the same problem on a fresh Android Studio V 1.2.1.1 installation. I created a new project (blank activity) and straightaway god this build error.

Error:Execution failed for task ':app:compileDebugAidl'.
> aidl is missing

As suggested, changing the gradle dependency from 1.2.3 to 1.3.0-beta1 fixed it.

classpath 'com.android.tools.build:gradle:1.3.0-beta1' // <--- WORKS! 
//classpath 'com.android.tools.build:gradle:1.2.3' // <--- default - failed

Once 1.3.0-beta1 change was saved, I got a prompt to upgrade dependencies. Upon accepting the request to upgrade, the gradle build status bar at the bottom tracked the packages being synced. When that completed, the build was automatically triggered and completed successfully.

查看更多
登录 后发表回答