I don't use JaCoCo, but I've used Cobertura. As far as I know, the main superficial difference between them is that JaCoCo does runtime instrumentation, and Cobertura does compile-time instrumentation. If have no idea whether your issue with JaCoCo is fixable, but if you need to do offline or compile-time instrumentation, then you should use Cobertura.
Processing with Cobertura is as as easy as this:
plugins {
id 'net.saliman.cobertura' version '2.2.5'
}
apply plugin: 'java'
test {
filter {
includeTestsMatching "*Test"
}
}
test.dependsOn coberturaCheck
cobertura {
coverageCheckBranchRate = 0
coverageCheckLineRate = 0
coverageCheckPackageBranchRate = 0
coverageCheckPackageLineRate = 0
coverageCheckTotalBranchRate = 0
coverageCheckTotalLineRate = 0
}