简体   繁体   中英

com.android.ddmlib.InstallException on CircleCi when trying to run tests

I did some searching around for this exception and saw that it's logged with Google as an Android bug, the only thing is it has been marked as fixed and released by them in an Android Studio release. However I am still experiencing it.

This is the full exception from CircleCi:

com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: Failed to establish session
    at com.android.builder.testing.ConnectedDevice.installPackages(ConnectedDevice.java:117)
    at com.android.builder.internal.testing.SimpleTestCallable.call(SimpleTestCallable.java:130)
    at com.android.builder.internal.testing.SimpleTestCallable.call(SimpleTestCallable.java:49)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
Caused by: com.android.ddmlib.InstallException: Failed to establish session
    at com.android.ddmlib.Device.installPackages(Device.java:894)
    at com.android.builder.testing.ConnectedDevice.installPackages(ConnectedDevice.java:113)
    ... 8 more

It happens when it gets to the ./gradlew --stacktrace connectedAndroidTest command in my circle.yml file.

Some other StackOverflow questions suggested setting a timeout, they were using TravisCI not CircleCi, but I tried it anyway and it has not worked. I set the timeout to 20minutes, but it still crashes. This is getting very annoying because all my builds are failing when they are passing on my machine.

Does anyone know the fix to this? Fine Google had a bug, and they supposedly fixed it, but CircleCi seem to still be having this problem, so the problem must still be there.

Would really appreciate some advice on this, CircleCi support is in another timezone so when I go to bed they are sending messages to me but I can't reply to the next morning when they are sleeping, so this has gone on for a week now and I've got no help from them.

Anyway, thanks for any help in advance. I can post my circle.yml file if you need it to help debug.

这个答案是我们通常所建议的,现在我们还没有找到更好的方法来处理这种异常。

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