我試圖在Gradle中生成一個Jacoco測試報告。當我嘗試同步我的代碼,我會收到以下錯誤:Gradle Jacoco - 找不到方法jacocoTestReport()
Error:(56, 0) Could not find method jacocoTestReport() for arguments [[email protected]] on project ':app' of type org.gradle.api.Project.
我的build.gradle文件包含以下項目:
apply plugin: 'jacoco'
jacoco {
toolVersion = "0.7.6.201602180812"
reportsDir = file("$buildDir/reports/jacoco")
}
jacocoTestReport {
group = "Reporting"
reports {
xml.enabled true
csv.enabled false
html.destination "${buildDir}/reports/coverage"
}
}
當我看documentation,我不看到我做錯了什麼。
搖籃版本:3.3
我爲什麼會收到這個錯誤,我該如何解決?
好吧,第一個解決方案爲我工作。 – Guido