在 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'.
第二次运行构建将成功。
使用 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 代码上的问题:https ://code.google.com/p/android/issues/detail?id=56158