Eugene Eugene - 1 year ago 109
Android Question

How to debug when running Robolectric tests in Android Studio?

I need to run debug while my tests execution in Android Studio + Robolectric.
Each time I try to run them by selecting

for the
task from Gradle tasks I get the error message:

Error running package_name:app_name [test]: Unable to open debugger
port : "Socket closed"

Any ideas?

Answer Source

I found the reason of the error. To make it run you need to uncheck the "Use in-process build" option in Compiler -> Gradle settings of Android Studio.

enter image description here

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download