Closed mattfbacon closed 8 months ago
try to add apply(plugin = "net.ltgt.errorprone")
Thanks for the heads-up @coolderli, and sorry for the delay @mattfbacon (I probably was on vacation at the time).
The issue is that the Android Gradle Plugin does not use standard Gradle source sets, so this plugin cannot setup annotationProcessor
configurations to extend from the errorprone
configuration; the compilation tasks are configured to use Error Prone but the dependency is not in the annotation processor path.
The solution is to declare Error Prone dependencies in the annotationProcessor
(or make this configuration extend from the errorprone
configuration) for each source set whose compilation task you enable Error Prone on.
Fwiw, this plugin had specific support for the AGP until version 3, where it was removed because the AGP API changed without a clear migration path (and I don't do android development myself). Nobody seems to have created an Android-specific plugin to add support on top of this plugin.
Similar to #52 , but I do have the line that they were missing.
Here's my build.gradle:
Running
./gradlew build
gives