简体   繁体   中英

Android Espresso tests won't run after upgrading to 3.0.1 android gradle plugin

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)

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM