1

I have just upgraded to com.android.tools.build:gradle:3.0.1 and latest Android Studio stable version(3.0.1) and suddenly my espresso tests won't run. I get the following error and don't have any idea about what it means. Any suggestions?

 [Device]: Error during Sync: Broken pipe
    com.android.ddmlib.InstallException: Broken pipe
            at com.android.ddmlib.Device.installPackage(Device.java:914)
            at com.android.builder.testing.ConnectedDevice.installPackage(ConnectedDevice.java:122)
            at com.android.builder.internal.testing.SimpleTestCallable.call(SimpleTestCallable.java:126)
            at com.android.builder.internal.testing.SimpleTestCallable.call(SimpleTestCallable.java:52)
  Caused by: java.io.IOException: Broken pipe
        at sun.nio.ch.FileDispatcherImpl.write0(Native Method)
        at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:47)
        at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93)
        at sun.nio.ch.IOUtil.write(IOUtil.java:65)
        at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:471)
        at com.android.ddmlib.AdbHelper.write(AdbHelper.java:927)
        at com.android.ddmlib.SyncService.doPushFile(SyncService.java:699)
        at com.android.ddmlib.SyncService.pushFile(SyncService.java:408)
        at com.android.ddmlib.Device.syncPackageToDevice(Device.java:954)
        at com.android.ddmlib.Device.installPackage(Device.java:910)
mbob
  • 590
  • 1
  • 4
  • 22
  • Did you do the basics, reboot device(s), clean project? Broken pipe seems to be caused because network is in a Schrodinger state, out of sync ie socket open on one side not the other – Pomagranite Feb 13 '18 at 15:35
  • Another thought is transitive dependencies are all yamed up. Any dependencies use different versions? – Pomagranite Feb 13 '18 at 15:36
  • I did reboot the device, cleaned the project... I'll check about some weird dependencies. – mbob Feb 13 '18 at 15:43
  • didn't find anything suspicious – mbob Feb 13 '18 at 16:02
  • In the stack trace your package is not listed so I think your code is not the problem. It is a matter of gradle and dependencies (as you kind of imply in the question) I saw a similar question recently. I will see what I can find – Pomagranite Feb 13 '18 at 19:57

1 Answers1

0

from this link and it is an old link but may still help. The solution

Try this: - change this url according to latest version in gradle-wrapper.properties and then change gradle.

distributionUrl=https://services.gradle.org/distributions/gradle-4.5.1-all.zip

Hope it helps Thanks

Pomagranite
  • 696
  • 5
  • 11