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'
}
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"
then there you have 2 options. I've changed both with the last version I had.
Compile SDK version to API 21 Lollipop
and Build Tools Version to 21.1.2
Finally clean the project and Build
UPDATED
TO Get Android Studio 1.3 follow these steps
Then you'll have something like this to update your Androud Studio to 1.3 and with this you can test Android M
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.
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:
Then click Launch Standalone SDK Manager at the bottom:
Now check whatever you need and install packages.
Hope it helps!
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:
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 lineclasspath com.android.tools.build:gradle:xxx
underdependencies
wherexxx
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.htmlIt has been fixed two days ago, so you can use:
with the newest android gradle plugin:
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:
EDIT 2
And yet again, there are newer version of both gradle plugin and build-tools, so you can switch to using:
and
To build your application without
aidl is missing
error withcompileSdkVersion 23
andbuildToolsVersion "23.0.1"
you should specify latest versions for Android Gradle plugin (and Google Play Services Gradle plugin if you are using it) in mainbuild.gradle
file: