NeoTech-Software/Android-Root-Coverage-Plugin

Classes in bundle 'app' do not match with execution data.

Closed this issue · 3 comments

Whatever task I try to run, I get this message:

[ant:jacocoReport] Classes in bundle 'app' do not match with execution data. For report generation the same class files must be used as at runtime.
[ant:jacocoReport] Execution data for class package/class/here does not match.

I only have unit tests, so I disabled androidTests. The report is generated, but the coverage is all 0%. I'm in Gradle 7.3.3, AGP 7.1.3, and plugin 1.5.3. My project is a mix of java and kotlin. (src/main/java and src/main/kotlin)

0neel commented

Check if you have any other plugin instrumenting your classes.

We had the same issue and the reason was Firebase Performance plugin instrumenting classes which breaks Jacoco instrumentation.

The fix was quite simple - disable Firebase Performance instrumentation for debug builds:

android {
  // ...
  buildTypes {
    debug {
      // ...
      FirebasePerformance {
        instrumentationEnabled false
      }
    }
  }
}

We also have a similar issue in another module but I suspect it's caused by All-open plugin.

@mihmilicio Sorry for this late response, like @0neel mentioned this can be caused by other plugins also changing class code (instrumenting classes). JaCoCo must be the last to instrument otherwise the classes don't match with execution data. It is hard to figure out without knowing more what is currently happening, but I suggest to look into the suggestions given by @0neel because that is usually the solution.

For now I closed this issue, if you need more assistance and feel like it has to do something with this plugin, feel free to re-open.