Код: Выделить всё
[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 *** does not match.
Кто-нибудь сталкивался с этой проблемой?
Вот моя конфигурация jacoco:
Код: Выделить всё
apply plugin: 'jacoco'
jacoco {
toolVersion '0.8.11'
}
tasks.withType(Test).configureEach {
jacoco.includeNoLocationClasses = true
jacoco.excludes = ['jdk.internal.*']
}
project.afterEvaluate {
tasks.register("defaultDebugCoverage", JacocoReport) {
dependsOn("testDefaultDebugUnitTest")
mustRunAfter('testDefaultDebugUnitTest')
group = "Reporting"
description = "Generate Jacoco coverage reports for the defaultDebug build."
reports {
html.required.set(true)
xml.required.set(true)
}
def excludes = [
'**/R.class',
'**/R$*.class',
'**/BuildConfig.*',
'**/Manifest*.*',
'**/*_Provide*Factory*.*',
'**/*_ViewBinding*.*',
'**/AutoValue_*.*',
'**/R2.class',
'**/R2$*.class',
'**/*Directions$*',
'**/*Directions.*',
'**/*Binding.*'
]
def jClasses = "${project.buildDir}/intermediates/javac/defaultDebug/classes"
def kClasses = "${project.buildDir}/tmp/kotlin-classes/defaultDebug"
def javaClasses = fileTree(dir: jClasses, excludes: excludes)
def kotlinClasses = fileTree(dir: kClasses, excludes: excludes)
classDirectories.from = files([javaClasses, kotlinClasses])
def sourceDirs = ["${project.projectDir}/src/main/java", "${project.projectDir}/src/main/kotlin",
"${project.projectDir}/src/defaultDebug/java", "${project.projectDir}/src/defaultDebug/kotlin"]
sourceDirectories.from = files(sourceDirs)
executionData.from = files(["${project.buildDir}/jacoco/testDefaultDebugUnitTest.exec"])
}
}
Источник: https://stackoverflow.com/questions/781 ... sentry-dep