As other people wrote, you have to set sourceSets
, i.e.:
task findbugs(type: FindBugs) {
// ignoreFailures = false
ignoreFailures = true
effort = 'max'
reportLevel = 'low'
excludeFilter = file("quality/findbugs/findbugs-filter.xml")
classes = files("${project.buildDir}/intermediates/javac/debug/classes",
source "${file(getProjectDir().getPath()).getAbsolutePath()}/src"
include '**/*.java'
exclude "${project.buildDir}/generated/**/*.java"
reports {
xml.enabled = true
xml {
destination file("findbugs/report.xml")
}
/*
html.enabled = true
html {
destination file("findbugs/report.html")
}
*/
/*
text.enabled = true
text {
destination file("findbugs/report.txt")
}
*/
}
classpath = files()
}
The problem is that when you upgrade version of Android Gradle Plugin, this path changes now and then.
In our project in different times it was of following values:
"${project.buildDir}/intermediates/classes/debug"
"${project.buildDir}/intermediates/javac/debug/compileDebugJavaWithJavac/classes"
"${project.buildDir}/intermediates/javac/debug/classes"
So if none of mentioned above values worked out, try to find actual classes in your build tree, maybe they just changed it again.