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.

Mykola
  • 435
  • 4
  • 17
  • 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. – Mykola Oct 26 '16 at 11:57

2 Answers2

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")
Mladen Rakonjac
  • 9,562
  • 7
  • 42
  • 55
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).

A.D.
  • 1,412
  • 2
  • 19
  • 37
  • That could be the right direction to look at. I use Dagger2 and that means there are classes generated as the project is assembled. – Mykola Feb 21 '17 at 08:42
  • Ah ok, try to work with dependsOn: https://docs.gradle.org/current/userguide/more_about_tasks.html#sec:adding_dependencies_to_tasks – A.D. Feb 21 '17 at 11:43