2

In my testdemo , i used jacoco and get coverage succeed。

demo build.gradle

android {
    jacoco {
        toolVersion "0.7.1.201405082137"
}
    buildTypes {
        debug {
            testCoverageEnabled true
        }
    }
}

but in my other project , i got error:

Tests on Google Nexus 4 - 4.3 - API 18 - 768x1280 - 4.3 failed: Instrumentation run failed due to 'java.lang.VerifyError'
05:43:43 E/Device: Error during Sync: Remote object doesn't exist!
null
java.io.IOException: Failed to pull /data/data/xx/coverage.ec from device
    at com.android.builder.testing.ConnectedDevice.pullFile(ConnectedDevice.java:115)
    at com.android.builder.internal.testing.SimpleTestCallable.call(SimpleTestCallable.java:158)
    at com.android.builder.internal.testing.SimpleTestCallable.call(SimpleTestCallable.java:42)
    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.SyncException: Remote object doesn't exist!
    at com.android.ddmlib.SyncService.pullFile(SyncService.java:314)
    at com.android.ddmlib.Device.pullFile(Device.java:873)
    at com.android.builder.testing.ConnectedDevice.pullFile(ConnectedDevice.java:108)
    ... 8 more
:app:connectedAndroidTest FAILED

FAILURE: Build failed with an exception.

OS : ubuntu 14.04

gradle : 1.11

android-studio: 0.8.2

sunhao111999
  • 79
  • 1
  • 6
  • @HieuRocker i saw your answer in http://stackoverflow.com/questions/18358297/android-test-code-coverage-with-jacoco-gradle-plugin/24231246. i got this error > Task with path 'testDebug' not found in project ':app'. – sunhao111999 Jul 22 '14 at 10:15
  • Meet same problem... – windkiosk Oct 02 '14 at 03:24

1 Answers1

1

In my case this was generated by using a device that did hasn't rooted. Have you tried to run the tests on an emulator?

ggarcia24
  • 382
  • 1
  • 8