I have an Android project which is a library and this library comes with its own demo project, as usual. The library is not developed by me, but I have the code. If I compile the demo project, with the build.gradle of the library with:
debug {
testCoverageEnabled true
}
Everything works perfectly, the demo project runs and the library works normally, but if I change to:
debug {
testCoverageEnabled false
}
When running the demo project I get the following error:
java.lang.NoClassDefFoundError: Failed resolution of: lorg/jacoco/agent/rt/internal_8ff85ea/Offline;
My problem is that I integrate this library (aar) in my own project and when I execute it, I always get the same error that the library gives when indicating testCoverageEnabled false.
I have tried to create the aar with testCoverageEnabled false even if it does not compile, I have changed the testCoverageEnabled in my project, etc... but I always get the same error.
It is important to say that jacoco is not implemented neither in the library nor in my project... No implementations, no plugin… nothing, I think this is very strange.
Updating gradle to the latest versions I don't get positive results.
How can I fix this?
I hope I have explained myself well.
Thanks in advance.