Android的工作室:失败的摇篮执行。原因:中断的管道摇篮、管道、原因、工作室

2023-09-07 14:33:08 作者:年轻人嘛,现在没钱算什么,以后没钱的日子还多着呢。今天小编为

每当我构建/运行我的机器人工作室的Andr​​oid项目,我得到一个消息框,说:无法完成摇篮execution.Cause:残破的管道然后将旧版本该应用程序的开始我的设备上运行。我试图清理项目,但我得到了同样的信息。我试图解决方案here但它并不能帮助。我也尝试过解决方案这里。我得到的 gradlew compileDebug --stacktrace --info 命令的输出如下:

 任务compileDebug'不明确根工程无线。候选人是:'compileDebugAidl','compileDebugJava','compileDebugNdk','compileDebugRenderscript','compileDebugTestAidl','compileDebugTestJava','compileDebugTestNdk','compileDebugTestRenderscript'。

* 尝试:
运行gradlew任务来获取可用的任务列表。与--debug选项来获得更多的日志输出运行。

*例外是:
org.gradle.execution.TaskSelectionException:任务compileDebug'不明确根工程无线。候选人是:'compileDebugAidl','compileDebugJava','compileDebugNdk','compileDebugRenderscript','compileDebugTestAidl','compileDebugTestJava','compileDebugTestNdk','compileDebugTestRenderscript'。
        在org.gradle.execution.TaskSelector.getSelection(TaskSelector.java:69)
 

我不断收到同样的错误。任何人都可以请帮助?

编辑:

我的 build.gradle 如下:

 应用插件:com.android.application

安卓{
    compileSdkVersion 15
    buildToolsVersion20.0.0

    defaultConfig {
        的applicationIDcom.example.pervysage.wifi
        的minSdkVersion 15
        targetSdkVersion 15
        版本code 1
        VERSIONNAME1.0
    }
    buildTypes {
        推出 {
            runProguard假
            proguardFiles getDefaultProguardFile('ProGuard的-android.txt'),'proguard-rules.pro
        }
    }
}

依赖{
    编译文件树(导演:库,包括:['的* .jar'])
}
 

解决方案

我有一个类似的问题,但注意到这一问题发生时我配置我的Linux笔记本电脑作为路由器。用例在这里是那么我会通过我的笔记本路线我的手机的WiFi流量和嗅探HTTP请求,同时调试。这似乎混淆摇篮和/或Android工作室。

卸下必要的iptables命令,killall -9 java和重新启动机器人工作室的问题消失。

如何实现RTMP推送Android Camera2数据

这是导致问题(这些和其他类似的命令会导致问题)的Linux命令:

的iptables -t NAT -A POSTROUTING -j MASQUERADE 回声1 GT;的/ proc / SYS /网络/的IPv4 / IP_FORWARD

在Linux上,我只是做到以下几点:

的iptables -t NAT -F 呼应0 GT;的/ proc / SYS /网络/的IPv4 / IP_FORWARD

记住,上述方案可能搞砸了你的防火墙,所以不要这个东西玩,除非你知道自己在做什么。

Whenever I build/run my android project in android-studio I get a message box saying: Failed to complete Gradle execution.Cause: Broken pipeand then the old version of the app starts running on my device. I tried to clean the project but I get the same message. I tried the solution here but it doesn't help. I also tried the solution here. I get the following output of the gradlew compileDebug --stacktrace --info command:

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)

I keep getting the same error. Can anyone please help?

Edit:

My build.gradle is as follows:

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

解决方案

I've had a similar problem, but noticed the problem occurred when I configured my Linux laptop as a router. The use-case here is I would then route my phone's WiFi traffic via my laptop and sniff HTTP requests while debugging. This seemed to confuse gradle and/or android studio.

Remove the necessary iptables commands, killall -9 java and restart android studio for the problem to go away.

The linux commands that cause the problem (these and other similar commands will cause the problem):

iptables -t nat -A POSTROUTING -j MASQUERADE echo 1 > /proc/sys/net/ipv4/ip_forward

On linux, I simply do the following:

iptables -t nat -F echo 0 > /proc/sys/net/ipv4/ip_forward

Bear in mind that the solution above may screw up your firewall so don't play with this stuff unless you know what you're doing.