Reputation: 631
Environment:
Mac OS 10.10.3
Android studio:1.2.11
grandle:2.2.1
the log:
Information:Gradle tasks [:generateDebugSources, :generateDebugTestSources]
:preBuild
:preDebugBuild
:checkDebugManifest
:prepareDebugDependencies
:compileDebugAidl FAILED
Error:Execution failed for task ':compileDebugAidl'.
> aidl is missing
// Top-level build file where you can add configuration options common to all sub-projects/modules.
import org.gradle.internal.os.OperatingSystem
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.0'
}
}
allprojects {
repositories {
jcenter()
}
}
String SDK_DIR = System.getenv("ANDROID_HOME")
if(SDK_DIR == null) {
Properties props = new Properties()
props.load(new FileInputStream(project.rootProject.file("local.properties")))
SDK_DIR = props.get('sdk.dir');
}
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.1"
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
jniLibs.srcDirs = ['libs']
}
// Move the tests to tests/java, tests/res, etc...
instrumentTest.setRoot('tests')
// Move the build types to build-types/<type>
// For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
// This moves them out of them default location under src/<type>/... which would
// conflict with src/ being used by the main source set.
// Adding new build types or product flavors should be accompanied
// by a similar customization.
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
defaultConfig {
minSdkVersion 14
targetSdkVersion 21
}
buildTypes {
release {
proguardFiles 'proguard.cfg'
}
}
lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}
}
dependencies {
compile fileTree(include: '*.jar', dir: 'libs')
provided files("${SDK_DIR}/platforms/android-17/data/layoutlib.jar")
//compile files('libs/pass-v1.1.3.jar')
// compile files('libs/sdk-v1.0.0.jar')
}
before this, I had compile the android resource 4.4 on my Mac, and modified some files in OS system, I think it is the reason is that, but I've forget which file, Someone encountered this problem yet
Upvotes: 43
Views: 62093
Reputation: 22212
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 was go to do 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
UPDATE Here is my build.gradle to compare with your build.gradle.
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion '21.1.2'
defaultConfig {
applicationId "com.android.bmi"
minSdkVersion 15
targetSdkVersion 22
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.2.0'
}
UPDATED
TO Get Android Studio 1.3 follow this steps
Then you'll have something like this to update your Android Studio to 1.3 and with this you can test Android M
Upvotes: 70
Reputation: 171
For those you are still getting the "aidl is missing" error:
To me, setting back the build tools version is not a solution at all.
On your top level build.gradle file, try setting:
classpath 'com.android.tools.build:gradle:1.3.0'
classpath 'com.google.gms:google-services:1.3.1'
and then use buildToolsVersion '23.0.1'
.
It worked perfectly for me. I hope it helps others.
Upvotes: 15
Reputation: 3827
In my experience, there is not about Compile Sdk Version or Build Tool Version, is about the New Project Structure. According to this issue, Aidl files are supposed to be in src/main/aidl, once you put *.aidl at the supposed directory, Android Studio would serve it as expect.
And If you want to have them in src/main/java, then you need the remapping instruction as you've specified, like below :
sourceSets {
main {
aidl.srcDirs = ['src/main/java']
}
}
btw, in my situation, the remapping approach work only by Gradle 2.4(also probably above version).
Upvotes: 1
Reputation: 631
I solve my issue, set the build tools version from 21.1.2 to 22.0.1, hope it can help who meet the same.
Upvotes: 20
Reputation: 9621
I followed screenshots from Jorge's post. But did not have API 21 as an option. So I kept Compiled SDK Version 'API 22: Android 5.1 (Lollipop)' as it is and changed Build Tool Version from 23.0.0 rc1 to 22.0.1
I also had to install JDK 7 since 22.0.1 did not support JDK 6. After that gradle build succeded.
Upvotes: 1
Reputation: 161
Following the screen shots from Jorge's post all you have to do is make sure you do not select Build Tools Version 23.0.0 rc1. I have not fully investigated that version in the IDE or on Google's bug tracker but all I had to do was pick the previous tool version and it worked just fine after doing a clean build. I tried this out with various SDK min versions.
I am running OSX 10.10.3 with Android Studio 1.2.1.1 running on Oracle JDK 1.8.0_45-b14
UPDATED WITH SOLUTION This issue is identical in nature to Execution failed for task ':app:compileDebugAidl': aidl is missing. Please read my post for the proper solution and references to the genesis of the solution.
Upvotes: 8
Reputation: 172
people who are building apps with android studio 1.3 preview might get Debug AIDL missing error Solution:(Follow in sequence) 1) Download all the tools under preview channel (i.e. revision no 23.0.0 rc1) 2) Download play servies and android support repo support under extras 3)Restart Android Studio 4)Press F4 and set compile SDK version to API 22+ and Build tool version 23.0.0 rc1 5)open build.gradle(Project:******) and change classpath line with classpath 'com.android.tools.build:gradle:1.3.+'
Upvotes: 2