Search code examples
androidandroid-gradle-pluginbuild.gradlegradlew

Android Buildtools 23.x.x wont compile


My application works fine with buildtools 22.x.x, but when I upgrade to 23.x.x and I try to compile I get this error:

Error:Execution failed for task ':appName:compileStagingDebugAndroidTestAidl'. > aidl is missing

I tried running the task from the terminal using

 ./gradlew compileStagingDebug 

and I get this

Task 'compileStagingDebug' is ambiguous in root project 'appName'compileStagingDebugAidl', 'compileStagingDebugAndroidTestAidl', 'compileStagingDebugAndroidTestJavaWithJavac', 'compileStagingDebugAndroidTestNdk', 'compileStagingDebugAndroidTestRenderscript', 'compileStagingDebugAndroidTestSources', 'compileStagingDebugJavaWithJavac', 'compileStagingDebugNdk', 'compileStagingDebugRenderscript', 'compileStagingDebugSources', 'compileStagingDebugUnitTestJavaWithJavac', 'compileStagingDebugUnitTestSources'.

None of these candidates make sense to me, I don't use android aidl nor I have any test. If I try to run any of these candidates I still get the error

> aidl is missing

This is happening only if I use buildTools 23.x.x, otherwise it's fine. My gradle file is this:

android {
compileSdkVersion 23
buildToolsVersion '23.0.1'
useLibrary 'org.apache.http.legacy'

defaultConfig {
    minSdkVersion 15
    targetSdkVersion 23
}
}

buildscript {
repositories {
    mavenCentral()
    maven { url 'https://maven.fabric.io/public' }
}
dependencies {
    classpath 'com.android.tools.build:gradle:1.3.0'
    classpath 'io.fabric.tools:gradle:1.+'
}
}

I have no idea how to solve this as it doesn't make any sense at all to me. I searched for similar problem but everyone is solving it by upgrading their gradle plugin to 1.3.0, which isn't working for me.


Solution

  • I actually found the problem.+

    Despite having set the gradle plugin to 1.3.0 in my gradle config file, in File -> Project Structure -> Project the Android plugin version was still set to 1.2.3

    Apparently this was overriding the settings in my file and was causing the issue.