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

2,656 views
Skip to first unread message

dmf...@gmail.com

unread,
Feb 29, 2016, 2:22:52 PM2/29/16
to JaCoCo and EclEmma Users
I am attempting to use JaCoCo with my Android application and this has recently started affecting my builds. Below is the full stacktrace:

02-29 11:28:18.266 28137-28137/org.mythtv.android I/art: Late-enabling -Xcheck:jni
02-29 11:28:18.325 28137-28137/org.mythtv.android W/System: ClassLoader referenced unknown path: /data/app/org.mythtv.android-1/lib/arm
02-29 11:28:18.329 28137-28137/org.mythtv.android I/InstantRun: BootstrapApplication created. Android package is org.mythtv.android, real application class is org.mythtv.android.presentation.AndroidApplication.
02-29 11:28:18.332 28137-28137/org.mythtv.android V/InstantRun: Cannot find external resources, not patching them in
02-29 11:28:18.332 28137-28137/org.mythtv.android I/InstantRun: Resource override is null

[ 02-29 11:28:18.661 192: 192 E/ ]
invalid crash request of size 4 (from pid=27961 uid=0)
02-29 11:28:19.579 28137-28137/org.mythtv.android I/InstantRun: Last code patch: /data/data/org.mythtv.android/files/instant-run/dex/slice-slice_9_9d59c89459597679fc6f58fe3125cc35fc00b9aa-classes.dex
02-29 11:28:19.579 28137-28137/org.mythtv.android I/InstantRun: APK last modified: 1456766894000 < 1456766899000 code patch
02-29 11:28:19.579 28137-28137/org.mythtv.android I/InstantRun: Bootstrapping class loader with dex list [/data/data/org.mythtv.android/files/instant-run/dex/slice-slice_9_9d59c89459597679fc6f58fe3125cc35fc00b9aa-classes.dex, /data/data/org.mythtv.android/files/instant-run/dex/slice-slice_8_b37d96a1e0c44f144dd123f857732c456d1af412-classes.dex, /data/data/org.mythtv.android/files/instant-run/dex/slice-slice_7_7f88559118af370b0508773c47042b5b623eac49-classes.dex, /data/data/org.mythtv.android/files/instant-run/dex/slice-slice_7_0899e125e5c812d8570d0fae7bc78aef116a0b67-classes.dex, /data/data/org.mythtv.android/files/instant-run/dex/slice-slice_6_a0de9e2d73a767b6e0c96bc483611b14591555a8-classes.dex, /data/data/org.mythtv.android/files/instant-run/dex/slice-slice_6_8da0cf2f81ea266c21205513573c99c8547f8c86-classes.dex, /data/data/org.mythtv.android/files/instant-run/dex/slice-slice_5_da446cc33d6f8c72bbe1599b8f6f4e99786bcebe-classes.dex, /data/data/org.mythtv.android/files/instant-run/dex/slice-slice_4_7ef5c75b1b7895877a08d5c3219b195ad47afcef-classes.dex, /data/data/org.mythtv.android/files/instant-run/dex/slice-slice_3_c1f04da6db7bc039486c763ae3e1990c7d1b099d-classes.dex, /data/data/org.mythtv.android/files/instant-run/dex/slice-slice_2_9edac97490b2e801daf8adc13ce0011db32543e1-classes.dex, /data/data/org.mythtv.android/files/instant-run/dex/slice-slice_1_3bcbc255e5f3eb65d6c4d7270de21b0a875787f6-classes.dex, /data/data/org.mythtv.android/files/instant-run/dex/slice-slice_1_02137d7e9c05d657a263bfa74e3a886ac831c54c-classes.dex, /data/data/org.mythtv.android/files/instant-run/dex/slice-slice_0_b16d97bdf152c58a71c38e126cf4da77a9a2960e-classes.dex, /data/data/org.mythtv.android/files/instant-run/dex/slice-dependencies_989883a18a411873f02d8967170ad1249c87b170-classes.dex]
02-29 11:28:19.580 28137-28137/org.mythtv.android I/InstantRun: Incremental dex path is /data/data/org.mythtv.android/files/instant-run/dex/slice-slice_9_9d59c89459597679fc6f58fe3125cc35fc00b9aa-classes.dex:/data/data/org.mythtv.android/files/instant-run/dex/slice-slice_8_b37d96a1e0c44f144dd123f857732c456d1af412-classes.dex:/data/data/org.mythtv.android/files/instant-run/dex/slice-slice_7_7f88559118af370b0508773c47042b5b623eac49-classes.dex:/data/data/org.mythtv.android/files/instant-run/dex/slice-slice_7_0899e125e5c812d8570d0fae7bc78aef116a0b67-classes.dex:/data/data/org.mythtv.android/files/instant-run/dex/slice-slice_6_a0de9e2d73a767b6e0c96bc483611b14591555a8-classes.dex:/data/data/org.mythtv.android/files/instant-run/dex/slice-slice_6_8da0cf2f81ea266c21205513573c99c8547f8c86-classes.dex:/data/data/org.mythtv.android/files/instant-run/dex/slice-slice_5_da446cc33d6f8c72bbe1599b8f6f4e99786bcebe-classes.dex:/data/data/org.mythtv.android/files/instant-run/dex/slice-slice_4_7ef5c75b1b7895877a08d5c3219b195ad47afcef-classes.dex:/data/data/org.mythtv.android/files/instant-run/dex/slice-slice_3_c1f04da6db7bc039486c763ae3e1990c7d1b099d-classes.dex:/data/data/org.mythtv.android/files/instant-run/dex/slice-slice_2_9edac97490b2e801daf8adc13ce0011db32543e1-classes.dex:/data/data/org.mythtv.android/files/instant-run/dex/slice-slice_1_3bcbc255e5f3eb65d6c4d7270de21b0a875787f6-classes.dex:/data/data/org.mythtv.android/files/instant-run/dex/slice-slice_1_02137d7e9c05d657a263bfa74e3a886ac831c54c-classes.dex:/data/data/org.mythtv.android/files/instant-run/dex/slice-slice_0_b16d97bdf152c58a71c38e126cf4da77a9a2960e-classes.dex:/data/data/org.mythtv.android/files/instant-run/dex/slice-dependencies_989883a18a411873f02d8967170ad1249c87b170-classes.dex
02-29 11:28:29.392 28137-28137/org.mythtv.android I/InstantRun: About to create real application of class name = org.mythtv.android.presentation.AndroidApplication
02-29 11:28:29.407 28137-28137/org.mythtv.android I/InstantRun: Created delegate app class successfully : class org.mythtv.android.presentation.AndroidApplication with class loader com.android.tools.fd.runtime.IncrementalClassLoader$DelegateClassLoader[DexPathList[[dex file "/data/data/org.mythtv.android/files/instant-run/dex/slice-slice_9_9d59c89459597679fc6f58fe3125cc35fc00b9aa-classes.dex", dex file "/data/data/org.mythtv.android/files/instant-run/dex/slice-slice_8_b37d96a1e0c44f144dd123f857732c456d1af412-classes.dex", dex file "/data/data/org.mythtv.android/files/instant-run/dex/slice-slice_7_7f88559118af370b0508773c47042b5b623eac49-classes.dex", dex file "/data/data/org.mythtv.android/files/instant-run/dex/slice-slice_7_0899e125e5c812d8570d0fae7bc78aef116a0b67-classes.dex", dex file "/data/data/org.mythtv.android/files/instant-run/dex/slice-slice_6_a0de9e2d73a767b6e0c96bc483611b14591555a8-classes.dex", dex file "/data/data/org.mythtv.android/files/instant-run/dex/slice-slice_6_8da0cf2f81ea266c21205513573c99c8547f8c86-classes.dex", dex file "/data/data/org.mythtv.android/files/instant-run/dex/slice-slice_5_da446cc33d6f8c72bbe1599b8f6f4e99786bcebe-classes.dex", dex file "/data/data/org.mythtv.android/files/instant-run/dex/slice-slice_4_7ef5c75b1b7895877a08d5c3219b195ad47afcef-classes.dex", dex file "/data/data/org.mythtv.android/files/instant-run/dex/slice-slice_3_c1f04da6db7bc039486c763ae3e1990c7d1b099d-classes.dex", dex file "/data/data/org.mythtv.android/files/instant-run/dex/slice-slice_2_9edac97490b2e801daf8adc13ce0011db32543e1-classes.dex", dex file "/data/data/org.mythtv.android/files/instant-run/dex/slice-slice_1_3bcbc255e5f3eb65d6c4d7270de21b0a875787f6-classes.dex", dex file "/data/data/org.mythtv.android/files/instant-run/dex/slice-slice_1_02137d7e9c05d657a263bfa74e3a886ac831c54c-classes.dex", dex file "/data/data/org.mythtv.android/files/instant-run/dex/slice-slice_0_b16d97bdf152c58a71c38e126cf4da77a9a2960e-classes.dex", dex file "/data/data/org.mythtv.android/files/instant-run/dex/slice-dependencies_989883a18a411873f02d8967170ad1249c87b170-classes.dex"],nativeLibraryDirectories=[/data/data/org.mythtv.android/lib, /vendor/lib, /system/lib]]]
02-29 11:28:29.407 28137-28137/org.mythtv.android I/InstantRun: Created real app instance successfully :org.mythtv.android.presentation.AndroidApplication@d481687
02-29 11:28:29.417 28137-28137/org.mythtv.android I/InstantRun: Starting server socket listening for package org.mythtv.android on android.net.LocalSocketAddress@36889dd
02-29 11:28:29.419 28137-28137/org.mythtv.android I/InstantRun: Started server for package org.mythtv.android
02-29 11:28:29.484 28137-28137/org.mythtv.android D/AndroidRuntime: Shutting down VM
02-29 11:28:29.488 28137-28137/org.mythtv.android E/AndroidRuntime: FATAL EXCEPTION: main
Process: org.mythtv.android, PID: 28137
java.lang.NoClassDefFoundError: Failed resolution of: Lorg/jacoco/agent/rt/internal_773e439/Offline;
at org.mythtv.android.data.cache.serializer.ProgramEntityJsonSerializer_Factory.$jacocoInit(ProgramEntityJsonSerializer_Factory.java:0)
at org.mythtv.android.data.cache.serializer.ProgramEntityJsonSerializer_Factory.<clinit>(ProgramEntityJsonSerializer_Factory.java)
at org.mythtv.android.presentation.internal.di.components.DaggerApplicationComponent.initialize(DaggerApplicationComponent.java:116)
at org.mythtv.android.presentation.internal.di.components.DaggerApplicationComponent.<init>(DaggerApplicationComponent.java:100)
at org.mythtv.android.presentation.internal.di.components.DaggerApplicationComponent.<init>(DaggerApplicationComponent.java:0)
at org.mythtv.android.presentation.internal.di.components.DaggerApplicationComponent$Builder.build(DaggerApplicationComponent.java:193)
at org.mythtv.android.presentation.AndroidApplication.initializeInjector(AndroidApplication.java:30)
at org.mythtv.android.presentation.AndroidApplication.onCreate(AndroidApplication.java:22)
at com.android.tools.fd.runtime.BootstrapApplication.onCreate(BootstrapApplication.java:305)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1013)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4707)
at android.app.ActivityThread.-wrap1(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: java.lang.ClassNotFoundException: Didn't find class "org.jacoco.agent.rt.internal_773e439.Offline" on path: DexPathList[[dex file "/data/data/org.mythtv.android/files/instant-run/dex/slice-slice_9_9d59c89459597679fc6f58fe3125cc35fc00b9aa-classes.dex", dex file "/data/data/org.mythtv.android/files/instant-run/dex/slice-slice_8_b37d96a1e0c44f144dd123f857732c456d1af412-classes.dex", dex file "/data/data/org.mythtv.android/files/instant-run/dex/slice-slice_7_7f88559118af370b0508773c47042b5b623eac49-classes.dex", dex file "/data/data/org.mythtv.android/files/instant-run/dex/slice-slice_7_0899e125e5c812d8570d0fae7bc78aef116a0b67-classes.dex", dex file "/data/data/org.mythtv.android/files/instant-run/dex/slice-slice_6_a0de9e2d73a767b6e0c96bc483611b14591555a8-classes.dex", dex file "/data/data/org.mythtv.android/files/instant-run/dex/slice-slice_6_8da0cf2f81ea266c21205513573c99c8547f8c86-classes.dex", dex file "/data/data/org.mythtv.android/files/instant-run/dex/slice-slice_5_da446cc33d6f8c72bbe1599b8f6f4e99786bcebe-classes.dex", dex file "/data/data/org.mythtv.android/files/instant-run/dex/slice-slice_4_7ef5c75b1b7895877a08d5c3219b195ad47afcef-classes.dex", dex file "/data/data/org.mythtv.android/files/instant-run/dex/slice-slice_3_c1f04da6db7bc039486c763ae3e1990c7d1b099d-classes.dex", dex file "/data/data/org.mythtv.android/files/instant-run/dex/slice-slice_2_9edac97490b2e801daf8adc13ce0011db32543e1-classes.dex", dex file "/data/data/org.mythtv.android/files/instant-run/dex/slice-slice_1_3bcbc255e5f3eb65d6c4d7270de21b0a875787f6-classes.dex", dex file "/data/data/org.mythtv.android/files/instant-run/dex/slice-slice_1_02137d7e9c05d657a263bfa74e3a886ac831c54c-classes.dex", dex file "/data/data/org.mythtv.android/files/instant-run/dex/slice-slice_0_b16d97bdf152c58a71c38e126cf4da77a9a2960e-classes.dex", dex file "/data/data/org.mythtv.android/files/instant-run/dex/slice-dependencies_989883a18a411873f02d8967170ad1249c87b170-classes.dex"],nativeLibraryDirectories=[/data/data/org.mythtv.android/lib, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at com.android.too
02-29 11:28:29.602 28137-28137/org.mythtv.android I/Process: Sending signal. PID: 28137 SIG: 9

Marc R. Hoffmann

unread,
Feb 29, 2016, 2:49:08 PM2/29/16
to jac...@googlegroups.com
Hi,

please verify:

- the JaCoCo runtime (jacocoagent.jar) file must be packaged with your
application
- It must be from the exact same JaCoCo release you used for
instrumentation (in your case 0.7.4).

Regards,
-marc

Marc R. Hoffmann

unread,
Feb 29, 2016, 2:49:17 PM2/29/16
to jac...@googlegroups.com
Hi,

please verify:

- the JaCoCo runtime (jacocoagent.jar) file must be packaged with your
application
- It must be from the exact same JaCoCo release you used for
instrumentation (in your case 0.7.4).

Regards,
-marc


On 29.02.16 20:22, dmf...@gmail.com wrote:

dmf...@gmail.com

unread,
Feb 29, 2016, 3:08:04 PM2/29/16
to JaCoCo and EclEmma Users
I have since added it to the app and it is the same version. However, it seems you have to do a full unistall of the app from the phone or tablet first in order to removed the error, even if you do a full clean and rebuild.

I guess I'm a bit confused. I really only want the jacoco stuff to fire when testing (cli, travis, coveralls). I don't want anything related to jacoco deployed with the app. There should be a way to limit this. Android Gradle has the notion of Product Flavors. I figure I could probably do something with that, but haven't quite worked out those details.

ahcwo...@gmail.com

unread,
Mar 30, 2016, 7:02:13 AM3/30/16
to JaCoCo and EclEmma Users, dmf...@gmail.com
Hello,

I have recently started experimenting with enabling testCodeCoverage for my Android application. I have come across the same issue, but I am attempting to narrow down what is causing this. I found out that when I add "testCodeCoverage=true" to my app's Gradle build script, I am able to create Jacoco test coverage reports just fine using the Gradle task "createDebugCoverageReport".

However, when I add a module (an IML module as I am using Android Studio) to the project and want to create coverage reports only for that module, the app crashes upon start as the agent did not get packaged with the application. This seems to be a bug in either the Android Gradle plugin or the Jacoco Gradle plugin. I have created a sample Android app in a public Github repo that will immediately crash: https://github.com/ronaldw/AndroidCodeCoverageInModuleIssue. The project description contains some more detailed explanation.

As this seems to be the same or a related issue, I was wondering what the status of the issue is or whether the behavior described above is intentional. Thanks!

- Ronald Wolvers

Marc Hoffmann

unread,
Mar 30, 2016, 7:54:23 AM3/30/16
to jac...@googlegroups.com
Hi Ronals,

thanks for the detailed analysis! If you think the problem is located in
the Android Gradle plugin or the Jacoco Gradle plugin please report the
problem at the respective projects. The JaCoCo plugin does not maintain
these plugins.

Regards,
-marc

ahcwo...@gmail.com

unread,
Mar 30, 2016, 8:50:42 AM3/30/16
to JaCoCo and EclEmma Users, dmf...@gmail.com
Hi Marc,

I have filed a new issue with AOSP here: https://code.google.com/p/android/issues/detail?id=205419. In case you are interested.


dmf...@gmail.com

unread,
Apr 26, 2016, 10:42:12 AM4/26/16
to JaCoCo and EclEmma Users, dmf...@gmail.com, ahcwo...@gmail.com
On Wednesday, March 30, 2016 at 8:50:42 AM UTC-4, ahcwo...@gmail.com wrote:
> Hi Marc,
>
> I have filed a new issue with AOSP here: https://code.google.com/p/android/issues/detail?id=205419. In case you are interested.

Any update on this. It has bitten me again. Now I have removed all JaCoCo from my gradle build files and it is still affecting me. I am not sure where this is coming from.

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