Execution failed for task ':app:compileDebugAidl': aidl is missing

AndroidAndroid StudioAndroid Gradle-Pluginbuild.gradleAidl

Android Problem Overview


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'
}

Android Solutions


Solution 1 - Android

In my case I downloaded version 22 of Android M and Android 5.1.1 using Android Studio 1.2.1.1 but when I try to do a Hello World this same error showed me

So the solution for me was doing right click in app like the image below and choose "Open Module Settings"

Image 1

then there you have 2 options. I've changed both with the last version I had.

Compile SDK version to API 21 Lollipop

enter image description here

and Build Tools Version to 21.1.2

enter image description here

Finally clean the project and Build

UPDATED

TO Get Android Studio 1.3 follow these steps

  1. Open the Settings window by choosing File > Settings.
  2. Choose the Appearance & Behavior > System Settings > Updates panel.
  3. On the Updates panel, choose the option Automatically check updates for: Canary Chanel.
  4. On the Updates panel, select Check Now to check for the latest canary build. Download and install the build when you are prompted.

Then you'll have something like this to update your Androud Studio to 1.3 and with this you can test Android M

Android 1.3

Update: Real Cause

This bug happens when the versions of SDK, Build Tools and Gradle Plugins doesn't match (in terms of compatibility). The solution is to verify whether you are using the latest version of them or not. The gradle plugins are placed in the build.gradle of the project, and the other versions are on the build.gradle of the module. For example, for SDK 23, you must use the Build Tools 23.0.1 and gradle plugins version 1.3.1.

Solution 2 - Android

It has been fixed two days ago, so you can use:

buildToolsVersion '23.0.0 rc2'

with the newest android gradle plugin:

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

Note: I had some weird problems with gradle 2.4 distribution, but trying to build the project again has fixed that for me.

EDIT

There is a newer version of build-tools 23, so you should probably use:

buildToolsVersion '23.0.0 rc3'

EDIT 2

And yet again, there are newer version of both gradle plugin and build-tools, so you can switch to using:

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

and

buildToolsVersion '23.0.0'

Solution 3 - Android

I had a similar error with a fresh install of Android Studio 1.2.1.1 attempting to build a new blank app for API 22: Android 5.1 (Lollipop).

I fixed it by simply changing the Build Tools Version from "23.0.0 rc1" to "22.0.1" and then rebuilding.

On Windows, F4 opens the Project Structure and the Build Tools Version can be set in the Modules > app section: enter image description here

I think all this does is change the setting in the build.gradle file in the app but I didn't want to change that manually just in case it does something more.

Solution 4 - Android

I tried to uninstall/install and it did not work. I am running OSX 10.10.3 with Android Studio 1.2.1.1 on JDK 1.8.0_45-b14 and the solution I found to work is similar to Jorge Casariego's recommendation. Basically, out of the box you get a build error for a missing 'aidl' module so simply changing the Build Tools Version to not be version 23.0.0 rc1 will solve your problem. It appears to have a bug.

UPDATE After commenting on an Android issue on their tracker (https://code.google.com/p/android/issues/detail?id=175080) a project member from the Android Tools group commented that to use the Build Tools Version 23.0.0 rc1 you need to be using Android Gradle Plugin 1.3.0-beta1 (Android Studio comes configured with 1.2.3). He also noted (read the issue comments) that the IDE should have given an notification that you need to do this to make it work. For me I have not seen a notification and I've requested clarification from that project member. Nonetheless his guidance solved the issue perfectly so read on.

Solution: Open your build.gradle for your Project (not Module). Find the line classpath com.android.tools.build:gradle:xxx under dependencies where xxx is the Gradle Plugin version and make the update. Save and Rebuild your project. Here is the Android Gradle docs for managing your Gradle versions: https://developer.android.com/tools/revisions/gradle-plugin.html

Solution 5 - Android

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()
    }
}

Solution 6 - Android

Quick fix that worked for me:

Right click on project->"Open Module Settings"->Build Tools Version change to: 22.0.1

enter image description here

Solution 7 - Android

To build your application without aidl is missing error with compileSdkVersion 23 and buildToolsVersion "23.0.1" you should specify latest versions for Android Gradle plugin (and Google Play Services Gradle plugin if you are using it) in main build.gradle file:

buildscript {
    repositories {
        ...
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.3.1'
        classpath 'com.google.gms:google-services:1.3.1'
    }
}

Solution 8 - Android

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.

Solution 9 - Android

I had the same error i fixed it by going to the build.gradle (Module: app) and changed this line from :

 buildToolsVersion "23.0.0 rc1"

to :

buildToolsVersion "22.0.1"

You will need to go the SDK Manager and check if you have the 22.0.1 build tools. If not, you can use the right build tools but avoid the 23.0.0 rc1.

Solution 10 - Android

Use your file browser and copy-paste the IInAppBillingService.aidl into /app/src/main/aidl/com/android/vending/billing/

Solution 11 - Android

The problem was actually in the version Android Studio 1.3 updated from the canary channel. I updated my studio to 1.3 and got the same error but reverting back to studio 1.2.1 made my project run fine.

Solution 12 - Android

buildtools layout in 23.0.0.rc2 was reverted

so to be able to use it, you need to upgrade the plugin to 1.3.0-beta2 or higher as i show below:

enter image description here

Solution 13 - Android

I am working with sdk 23.1.0 and gradle 1.3.1. I created a new project edited nothing and got the aidl error. I went into my project gradle file and changed tool to 22.0.1 instead of 23.1.0 and it worked:

   compileSdkVersion 23
   buildToolsVersion "22.0.1" //"23.1.0"

Solution 14 - Android

Check if you actually have installed the buildVersionTools you are using. In my case I tried 25.0.1 whilst I only had 25.0.2.

To check it go to the SDK Manager, clicking the icon:

enter image description here

Then click Launch Standalone SDK Manager at the bottom:

enter image description here

Now check whatever you need and install packages.

enter image description here

Hope it helps!

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionuser4813855View Question on Stackoverflow
Solution 1 - AndroidJorge CasariegoView Answer on Stackoverflow
Solution 2 - AndroidscanaView Answer on Stackoverflow
Solution 3 - AndroidGruffView Answer on Stackoverflow
Solution 4 - AndroidJohnny MohseniView Answer on Stackoverflow
Solution 5 - AndroidMatt DaleyView Answer on Stackoverflow
Solution 6 - AndroidCommonSenseCodeView Answer on Stackoverflow
Solution 7 - AndroidmixelView Answer on Stackoverflow
Solution 8 - AndroidsithView Answer on Stackoverflow
Solution 9 - AndroidJosephView Answer on Stackoverflow
Solution 10 - AndroidBoris KarloffView Answer on Stackoverflow
Solution 11 - AndroidLogicView Answer on Stackoverflow
Solution 12 - Androidceph3usView Answer on Stackoverflow
Solution 13 - AndroidJenniferGView Answer on Stackoverflow
Solution 14 - AndroidTeo InkeView Answer on Stackoverflow