java.lang.NoClassDefFoundError: Failed resolution of: Lorg/jacoco/agent/rt/internal_8ff85ea/Offline;

494 views
Skip to first unread message

ryanj...@gmail.com

unread,
Aug 30, 2017, 11:53:15 AM8/30/17
to JaCoCo and EclEmma Users
All,

I ran into this crasher in my Android application. This happens on launch when the jacoco plugin has been applied to a gradle plugin we have written, which is applied to our project. I was able to find some documentation on this issue on the [FAQ.](http://www.jacoco.org/jacoco/trunk/doc/faq.html)

I have been added the following to my build.gradle and it resolves the crasher:
//required for jacoco
// compile 'org.jacoco:org.jacoco.agent:0.7.9:runtime'
However, I don't understand why this is necessary. Why is jacoco effecting my runtime, and does anyone know of a way to turn off offline mode? For some reason even without the additional dependency my instrumentation tests run fine on a device w/o crashing. Code coverage is coming through fine as well w/o this dependency.

Evgeny Mandrikov

unread,
Sep 4, 2017, 6:16:31 PM9/4/17
to JaCoCo and EclEmma Users, ryanj...@gmail.com
Don't you think that statements
fine w/o dependency
and
resolves by addition of dependency
are contradicting each other?

As stated in FAQ this dependency is absolutely mandatory for the case of offline instrumentation. And offline instrumentation is the only way to get coverage on Android, simply because there is no such thing as Java agent on Android.

Classes instrumented by different JaCoCo versions will have dependency on different versions of package "internal_*". Based on your contradictional description, the only wild guess - is that some of your tools/plugins are doing offline instrumentation by one version and automatically add corresponding dependency, while some others are doing offline instrumentation by another version and do not add dependency.

All in all watch out what your build, tools and plugins are doing and how they do this.

Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages