【发布时间】:2014-09-22 15:43:55
【问题描述】:
每当我在 android-studio 中构建/运行我的 android 项目时,我都会收到一个消息框:Failed to complete Gradle execution.Cause: Broken pipe然后旧版本的应用程序开始在我的设备上运行。我试图清理项目,但我得到了同样的信息。我尝试了解决方案here,但没有帮助。我还尝试了解决方案here。我得到gradlew compileDebug --stacktrace --info 命令的以下输出:
Task 'compileDebug' is ambiguous in root project 'Wifi'. Candidates are: 'compileDebugAidl', 'compileDebugJava', 'compileDebugNdk', 'compileDebugRenderscript', 'compileDebugTestAidl', 'compileDebugTestJava', 'compileDebugTestNdk', 'compileDebugTestRenderscript'.
* Try:
Run gradlew tasks to get a list of available tasks. Run with --debug option to get more log output.
* Exception is:
org.gradle.execution.TaskSelectionException: Task 'compileDebug' is ambiguous in root project 'Wifi'. Candidates are: 'compileDebugAidl', 'compileDebugJava', 'compileDebugNdk', 'compileDebugRenderscript', 'compileDebugTestAidl', 'compileDebugTestJava', 'compileDebugTestNdk', 'compileDebugTestRenderscript'.
at org.gradle.execution.TaskSelector.getSelection(TaskSelector.java:69)
我不断收到同样的错误。有人可以帮忙吗?
编辑:
我的build.gradle如下:
apply plugin: 'com.android.application'
android {
compileSdkVersion 15
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "com.example.pervysage.wifi"
minSdkVersion 15
targetSdkVersion 15
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
}
【问题讨论】:
-
你是在模拟器还是设备上试用?
-
在 app 文件夹中分享你的 build.gradle
-
@nr4bt - 我正在尝试使用设备。这有关系吗?
-
@DheerajBhaskar - 请参阅编辑。
-
似乎是正确的,我记得在 AndroidStudio Release 页面上看到过这个错误。你在最新版本吗?如果没有,请更新。使用金丝雀频道。