Android Studio:Gradle 构建失败——任务“:compileDebugAidl"执行失败 [英] Android Studio: Gradle build fails -- Execution failed for task ':compileDebugAidl'

查看:131
本文介绍了Android Studio:Gradle 构建失败——任务“:compileDebugAidl"执行失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Android Studio(I/O 预览版)AI - 130.677228 中更改源代码并使用 gradle 构建后,构建失败并出现以下错误:

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.

使用 1.6 版的 gradle 包装器

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?

编辑以包含 build.gradle

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

Google Code 上的问题链接:https://code.google.com/p/android/issues/detail?id=56158

Link to issue on Google Code: https://code.google.com/p/android/issues/detail?id=56158

推荐答案

我不确定这怎么可能.您似乎在 Gradle 插件本身与其提供 WaitableExecutor 类的依赖项之间存在不匹配.

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.

但是你提到了 Gradle 1.5,这是一个问题.

However you mention Gradle 1.5 and this is a problem.

插件版本 0.3 兼容 Gradle 1.3-1.4上周新版本发布,0.4兼容Gradle 1.6+

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+

确保您使用 0.4 和新的 Gradle 版本.

Make sure you use 0.4 and the new Gradle version.

这篇关于Android Studio:Gradle 构建失败——任务“:compileDebugAidl"执行失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆