On Saturday, March 3, 2018 at 1:25:21 AM UTC+5:30, [email protected] wrote:
> 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?

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

-- 
You received this message because you are subscribed to the Google Groups 
"JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/dbb8dd69-378c-4383-888d-026d86714bd0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to