无法使用gradle在Android Studino中调试JUnit + Roboloctric测试

时间:2014-09-02 11:36:22

标签: android junit gradle robolectric

昨天工作正常!

但今天我无法使用debug junit test运行。我不明白会发生什么 Logcat:

17:25:43.540 [ERROR] [system.err] ERROR: transport error 202: connect failed: Connection refused                                   
17:25:43.540 [QUIET] [system.out] FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)
17:25:43.540 [ERROR] [system.err] ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)       
17:25:43.541 [ERROR] [system.err] JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [../../../src/share/back/debugInit.c:741]
17:25:43.927 [ERROR] [org.gradle.process.internal.streams.ExecOutputHandleRunner] Could not write standard input into: Gradle Test Executor 2.
java.io.IOException: Broken pipe
    at java.io.FileOutputStream.writeBytes(Native Method)
    at java.io.FileOutputStream.write(FileOutputStream.java:318)
    at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
    at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
    at org.gradle.process.internal.streams.ExecOutputHandleRunner.run(ExecOutputHandleRunner.java:50)
    at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:64)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)

UPD
在这个问题中,“Broken pipe error when running Gradle test”是防病毒中的一个问题。但我没有。

1 个答案:

答案 0 :(得分:1)

您有任何连接问题吗?

  

错误:传输错误202:连接失败:连接被拒绝

通过代理执行我的测试时遇到了类似的问题。