After changes to source and building with gradle in Android Studio (I/O preview) AI - 130.677228 the build fails with the following error:
Gradle:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileDebugAidl'.
> No signature of method: com.android.ide.common.internal.WaitableExecutor.waitForTasks() is applicable for argument types: () values: []
Possible solutions: waitForAllTasks()
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Could not execute build using Gradle distribution 'http://services.gradle.org/distributions/gradle-1.6-bin.zip'.
The second time running a build the build will succeed.
Using a gradle wrapper with version 1.6
This really sucks because it does a long build (non-incremental) after it fails the first time.
Is there a way to not have this failure?
EDIT to include build.gradle
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.4'
}
}
apply plugin: 'android'
task wrapper(type: Wrapper) {
gradleVersion = '1.6'
}
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
}
android {
compileSdkVersion "Google Inc.:Google APIs:17"
buildToolsVersion "17"
defaultConfig {
minSdkVersion 11
targetSdkVersion 17
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
instrumentTest.setRoot('tests')
}
}
Link to issue on Google Code: https://code.google.com/p/android/issues/detail?id=56158
Run a Gradle task in the Run Anything windowIn the Run Anything window, start typing a name of the task you want to execute. To execute several tasks, enter task names using space to separate each new task. Alternatively, scroll down to the Gradle tasks section and select the task you need.
I solved this issue by setting buildToolsVersion
in my build.gradle
file to match the latest version of the Android SDK Build-tools in the SDK manager.
In my case, I have the Android SDK Build-tools version 22.0.1 installed, so I set buildToolsVersion
accordingly:
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
...
After making that change, my app builds uneventfully.
I'm not sure how this is possible. It looks like you have a mismatch between the Gradle plugin itself and its dependencies that provides the WaitableExecutor class.
However you mention Gradle 1.5 and this is a problem.
The plugin version 0.3 was compatible with Gradle 1.3-1.4 The new version release last week, 0.4 is compatible with Gradle 1.6+
Make sure you use 0.4 and the new Gradle version.
I was facing the same issue "Failed to execute the task: compileDebugaidl aidl/debug/".
I saw further in Gradle Console for the specifics and it read as below:
Failed to capture snapshot of output files for task 'prepareComAndroidSupportAppcompatV72103Library' during up-to-date check.
Could not remove entry '/Users/..../.../.../..../build/intermediates/exploded-aar/com.android.support/appcompat-v7/21.0.3' from cache outputFileStates.bin (/Users/..../..../..../.gradle/2.2.1/taskArtifacts/outputFileStates.bin).
I resolved it by deleting the outputFileStates.bin file from the terminal and allowed Gradle to recreate it.
Hope it helps somebody.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With