Cannot read execution data version 0x1006. This version of JaCoCo uses execution data version 0x1007

4,397 views
Skip to first unread message

tth...@hq.bill.com

unread,
Mar 2, 2018, 2:55:21 PM3/2/18
to JaCoCo and EclEmma Users
Hi,
I'm running into a strange issue when trying to generate the jacoco coverage report via ant:

jacocoReport:^M
parsing buildfile jar:file:/C:/ant/apache-ant-1.7.1/lib/jacocoant-0.7.9.jar!/org/jacoco/ant/antlib.xml with URI = jar:file:/C:/ant/apache-ant-1.7.1/lib/jacocoant-0.7.9.jar!/org/jacoco/ant/antlib.xml^M
[jacoco:report] Loading execution data file c:\cv_test\1010\jacoco.exec^M
^M
BUILD FAILED^M
C:\cv_test\1010\build\build-test.xml:203: Unable to read execution data file c:\cv_test\1010\jacoco.exec^M
at org.jacoco.ant.ReportTask.loadExecutionData(ReportTask.java:516)^M
at org.jacoco.ant.ReportTask.execute(ReportTask.java:490)^M
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)^M
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)^M
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)^M
at java.lang.reflect.Method.invoke(Unknown Source)^M
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)^M
at org.apache.tools.ant.Task.perform(Task.java:348)^M
at org.apache.tools.ant.Target.execute(Target.java:357)^M
at org.apache.tools.ant.Target.performTasks(Target.java:385)^M
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)^M
at org.apache.tools.ant.Project.executeTarget(Project.java:1306)^M
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)^M
at org.apache.tools.ant.Project.executeTargets(Project.java:1189)^M
at org.apache.tools.ant.Main.runBuild(Main.java:758)^M
at org.apache.tools.ant.Main.startAnt(Main.java:217)^M
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)^M
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)^M
Caused by: org.jacoco.core.data.IncompatibleExecDataVersionException: Cannot read execution data version 0x1006. This version of JaCoCo uses execution data version 0x1007.^M
at org.jacoco.core.data.ExecutionDataReader.readHeader(ExecutionDataReader.java:129)^M
at org.jacoco.core.data.ExecutionDataReader.readBlock(ExecutionDataReader.java:109)^M
at org.jacoco.core.data.ExecutionDataReader.read(ExecutionDataReader.java:92)^M
at org.jacoco.core.tools.ExecFileLoader.load(ExecFileLoader.java:59)^M
at org.jacoco.ant.ReportTask.loadExecutionData(ReportTask.java:514)^M
... 17 more^M
--- Nested Exception ---^M
org.jacoco.core.data.IncompatibleExecDataVersionException: Cannot read execution data version 0x1006. This version of JaCoCo uses execution data version 0x1007.^M
at org.jacoco.core.data.ExecutionDataReader.readHeader(ExecutionDataReader.java:129)^M
at org.jacoco.core.data.ExecutionDataReader.readBlock(ExecutionDataReader.java:109)^M
at org.jacoco.core.data.ExecutionDataReader.read(ExecutionDataReader.java:92)^M
at org.jacoco.core.tools.ExecFileLoader.load(ExecFileLoader.java:59)^M
at org.jacoco.ant.ReportTask.loadExecutionData(ReportTask.java:514)^M
at org.jacoco.ant.ReportTask.execute(ReportTask.java:490)^M
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)^M
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)^M
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)^M
at java.lang.reflect.Method.invoke(Unknown Source)^M
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)^M
at org.apache.tools.ant.Task.perform(Task.java:348)^M
at org.apache.tools.ant.Target.execute(Target.java:357)^M
at org.apache.tools.ant.Target.performTasks(Target.java:385)^M
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)^M
at org.apache.tools.ant.Project.executeTarget(Project.java:1306)^M
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)^M
at org.apache.tools.ant.Project.executeTargets(Project.java:1189)^M
at org.apache.tools.ant.Main.runBuild(Main.java:758)^M
at org.apache.tools.ant.Main.startAnt(Main.java:217)^M
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)^M
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)^M
^M

Jacoco is complaining about the data version but I'm using the same version to run jacoco:coverage and jacoco:report. I've verified this by running ant with the verbose option. I see this in the log file:

JACOCO COVERAGE:
parsing buildfile jar:file:/C:/ant/apache-ant-1.7.1/lib/jacocoant-0.7.9.jar!/org/jacoco/ant/antlib.xml with URI = jar:file:/C:/ant/apache-ant-1.7.1/lib/jacocoant-0.7.9.jar!/org/jacoco/ant/antlib.xml^M
[jacoco:coverage] Enhancing testng with coverage^M
[testng] '-javaagent:C:\Users\devops\AppData\Local\Temp\jacocoagent245892142721300852.jar=destfile=C:\cv_test\1010\build\jacoco.exec,excludes=*cv/core/label/Labels'^M

JACOCO REPORT:
jacocoReport:^M
parsing buildfile jar:file:/C:/ant/apache-ant-1.7.1/lib/jacocoant-0.7.9.jar!/org/jacoco/ant/antlib.xml with URI = jar:file:/C:/ant/apache-ant-1.7.1/lib/jacocoant-0.7.9.jar!/org/jacoco/ant/antlib.xml^M
[jacoco:report] Loading execution data file c:\cv_test\1010\jacoco.exec^M
^M
BUILD FAILED^M
C:\cv_test\1010\build\build-test.xml:203: Unable to read execution data file c:\cv_test\1010\jacoco.exec^M

So from the log it looks like both tasks parse the same jacocoant-0.7.9.jar file, but I'm still getting this error when trying to generate the report.

I'm kind of out of ideas of what else to check at this point. Anyone have any ideas?

shobhitag...@gmail.com

unread,
Mar 9, 2018, 5:45:31 AM3/9/18
to JaCoCo and EclEmma Users

I also faced the version mismatch while trying to generate coverage report for unit tests and instrumentation tests in android. The solution was to match to version of both the exec files to same.
Look at this page to check the versions https://github.com/jacoco/jacoco/wiki/ExecFileVersions

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