I'm trying to update my app to the new android gradle plugin 3.0.0-alpha1. I've went through the migration guide at https://developer.android.com/studio/preview/features/new-android-plugin-migration.html and as far as I can tell everything is as it's suppose to be. I've tripled check this.
My project setup is quite simple I have a lib2
that depends on lib1
. Everything runs smoothly until code coverage comes into play. All tests in lib1
run without a problem, but the tests in lib2
that hit code from lib1
throw the famous exception:
java.lang.ClassNotFoundException: org.jacoco.agent.rt.internal_773e439.Offline
All other tests from lib2
run without a single problem.
I've tried every solution I found on the web. From forcing the version of jacoco for both libs. Using the one that comes packaged with the android plugin. Using the standalone jacoco plugin. Excluding the problematic classes from code coverage. Moving the tests to a separate module, which produces a greater amount of failures with the given exception. It seems that every time a library depends on another, this fails.
The weirdest part is that unpacking the jacoco agent reveals that the class is actually there - for both libs.
Has anyone come across the issue and has a solution? Thank you