10
votes

I had configured Jenkins build to build gradle project and run tests on it (using connectedInstrumentTest) but build fail several seconds after start.

Stacktrace:

com.android.ddmlib.InstallException at com.android.ddmlib.Device.installPackage(Device.java:884) at com.android.builder.testing.ConnectedDevice.installPackage(ConnectedDevice.java:78) at com.android.builder.internal.testing.SimpleTestCallable.call(SimpleTestCallable.java:97) at com.android.builder.internal.testing.SimpleTestCallable.call(SimpleTestCallable.java:40) 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:744) Caused by: com.android.ddmlib.TimeoutException at com.android.ddmlib.AdbHelper.read(AdbHelper.java:686) at com.android.ddmlib.SyncService.doPushFile(SyncService.java:695) at com.android.ddmlib.SyncService.pushFile(SyncService.java:380) at com.android.ddmlib.Device.syncPackageToDevice(Device.java:906) at com.android.ddmlib.Device.installPackage(Device.java:875) ... 9 more

com.android.builder.testing.ConnectedDevice > runTests[sdk - 4.4.2] [31mFAILED [0m

com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException at com.android.builder.testing.ConnectedDevice.installPackage(ConnectedDevice.java:81)

null com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException at com.android.builder.testing.ConnectedDevice.installPackage(ConnectedDevice.java:81) at com.android.builder.internal.testing.SimpleTestCallable.call(SimpleTestCallable.java:97) at com.android.builder.internal.testing.SimpleTestCallable.call(SimpleTestCallable.java:40) 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:744) Caused by: com.android.ddmlib.InstallException at com.android.ddmlib.Device.installPackage(Device.java:884) at com.android.builder.testing.ConnectedDevice.installPackage(ConnectedDevice.java:78) ... 8 more Caused by: com.android.ddmlib.TimeoutException at com.android.ddmlib.AdbHelper.read(AdbHelper.java:686) at com.android.ddmlib.SyncService.doPushFile(SyncService.java:695) at com.android.ddmlib.SyncService.pushFile(SyncService.java:380) at com.android.ddmlib.Device.syncPackageToDevice(Device.java:906) at com.android.ddmlib.Device.installPackage(Device.java:875) ... 9 more :MobileShowcaseApp:connectedInstrumentTest FAILED

I changed emulator configuration and it helps - it can connect to new created device, but when tests are rerun device exception is throw again (reinstaling SDK, gradle did not work).

1
Are you able to run the test outside of Jenkins? It seems that when the test is running in Jenkins that no device/emulator is available.AndroidGuy
Yes, I can run tests outside from Jenkins.Unii

1 Answers

1
votes

It would have been better if I could have seen your system but this helped me when I was installing http://blog.zuehlke.com/configure-your-android-project-on-jenkins/

This should work fine.Try this. All the best!!