Findbugs fails with "java.io.IOException: No files to analyze could be opened"
Asked Answered
D

2

5

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.

Disturbed answered 4/10, 2016 at 12:10 Comment(1)
I've updated to the Android Studio to 2.2.2, gradle to 2.2.2, gradle wrapper to 2.14.1. The problem is still arising from time to time.Disturbed
G
8

If you use 3.2, please take a note that

classes = files("$project.buildDir/intermediates/classes")

should be

classes = files("$project.buildDir/intermediates/javac")
Gregson answered 8/10, 2018 at 13:55 Comment(1)
This solved it for me, thanks! I bumped into this issue after upgrading my project to v3.2Ambivalence
D
1

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).

Distributee answered 21/2, 2017 at 7:53 Comment(2)
That could be the right direction to look at. I use Dagger2 and that means there are classes generated as the project is assembled.Disturbed
Ah ok, try to work with dependsOn: docs.gradle.org/current/userguide/…Distributee

© 2022 - 2024 — McMap. All rights reserved.