问题
I run an Android Studio v2.1.3 and use ./gradlew build
to detect errors in the Android project with the Findbags.
Recently an error started to come up:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':process:customFindbugs'.
> java.io.IOException: No files to analyze could be opened
There are enough disk space and RAM and beside that I don't see any particular reason for that error to occur. Please help to elaborate on this problem.
回答1:
If you use 3.2, please take a note that
classes = files("$project.buildDir/intermediates/classes")
should be
classes = files("$project.buildDir/intermediates/javac")
回答2:
I had the same problem after reorganizing my gradle files. This is the actual command:
gradlew --stacktrace assemble findbugs
Accidentally, I did this:
gradlew --stacktrace findbugs
With the first command no error arises, with later it shows "java.io.IOException: No files to analyze could be opened". To cut a long story short, maybe your files weren't compiled (yet).
来源:https://stackoverflow.com/questions/39851965/findbugs-fails-with-java-io-ioexception-no-files-to-analyze-could-be-opened