Hey, I just updated my gradle from version 2.2 to latest one 2.8. I didn’t have any issue with findbugs on version 2.2.
I’m working on an Android project that contains two modules. In order to use find bugs in both modules I have following configuration on main build.gradle file of root directory.
When I run ./gradlew findbugs on my local machine everything is fine and build is successful however when I push my PR to Github and Trivis tries to build then I get error:
:findbugs UP-TO-DATE
:passenger-app:findbugs
:passenger-sdk:findbugs FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':passenger-sdk:findbugs'.
> FindBugs rule violations were found. See the report at: file:///home/travis/build/project-name/passenger-android/passenger-sdk/build/reports/findbugs/findbugs.html
I’m really confused why I have no problem on my local machine while Travis shows error! I’m using java 1.8 while Travis is using 1.7. Does problem relates to this? Thanks
You are right I got few errors and fixed them. I also added annotation.jar and jsr305.jar int to my libs folder in order to use SuppressFBWarnings. Now there is no blocker by Findbugs, however I’m getting another problem when I try to build the project.
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Ljavax/annotation/CheckForNull;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:502)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:334)
at com.android.dx.command.dexer.Main.run(Main.java:277)
at com.android.dx.command.dexer.Main.main(Main.java:245)
at com.android.dx.command.Main.main(Main.java:106)
Error:Execution failed for task ':passenger-app:dexTaxDebug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/usr/lib/jvm/java-8-oracle/bin/java'' finished with non-zero exit value 2
Some solutions are based on Multidex activation for android due to pass of 65k method limitation. I guess I can do something before going for multidex approach.
I found something strange by running ./geadlew dependencies
$ ./gradlew -q dependencies
------------------------------------------------------------
Root project
------------------------------------------------------------
findbugs - The FindBugs libraries to be used for this project.
\--- com.google.code.findbugs:findbugs:3.0.1 FAILED
findbugsPlugins - The FindBugs plugins to be used for this project.
No dependencies
I don’t understand what it says exactly
Does it mean Gradle has confused because I added those two jar files and plugin have them already?