Android Studio: Gradle ビルドが失敗しました -- タスク ':compileDebugAidl' の実行に失敗しました 質問する

Android Studio: Gradle ビルドが失敗しました -- タスク ':compileDebugAidl' の実行に失敗しました 質問する

Android Studio (I/O プレビュー) AI - 130.677228 でソースを変更し、Gradle を使用してビルドすると、次のエラーが発生してビルドが失敗します。

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

2 回目にビルドを実行すると、ビルドは成功します。

バージョン1.6のGradleラッパーを使用する

これは、最初の失敗後に長いビルド (非増分ビルド) を実行するため、非常に厄介です。

この失敗を起こさない方法はあるのでしょうか?

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

Google Code の問題へのリンク:出典: google.com

ベストアンサー1

私は、SDK マネージャーの Android SDK ビルド ツールの最新バージョンと一致するようにファイルbuildToolsVersionを設定することでこの問題を解決しました。build.gradle

ビルドツールバージョン22.0.1がインストールされていることを示しています

私の場合はAndroid SDK Build-toolsバージョンを使用しています22.0.1インストールされたので、buildToolsVersionそれに応じて設定しました:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 22
    buildToolsVersion "22.0.1"
...

変更を加えると、アプリは問題なくビルドされます。

おすすめ記事