Dagger 2.14.1
Perhaps more classes require shading?
...
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at net.ltgt.gradle.errorprone.ErrorProneCompiler.execute(ErrorProneCompiler.java:66)
... 57 more
Caused by: java.lang.RuntimeException: java.lang.NoSuchMethodError: com.google.common.base.Verify.verify(ZLjava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V
at com.sun.tools.javac.api.JavacTaskImpl.handleExceptions(JavacTaskImpl.java:158)
at com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:96)
at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:90)
at com.google.errorprone.BaseErrorProneCompiler.run(BaseErrorProneCompiler.java:137)
at com.google.errorprone.BaseErrorProneCompiler.run(BaseErrorProneCompiler.java:108)
at com.google.errorprone.ErrorProneCompiler.run(ErrorProneCompiler.java:118)
at com.google.errorprone.ErrorProneCompiler.compile(ErrorProneCompiler.java:65)
... 62 more
Caused by: java.lang.NoSuchMethodError: com.google.common.base.Verify.verify(ZLjava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V
at dagger.internal.codegen.BindingGraph$Factory.create(BindingGraph.java:349)
at dagger.internal.codegen.BindingGraph$Factory.create(BindingGraph.java:342)
at dagger.internal.codegen.BindingGraph$Factory.create(BindingGraph.java:342)
at dagger.internal.codegen.BindingGraph$Factory.create(BindingGraph.java:244)
at dagger.internal.codegen.ComponentProcessingStep.process(ComponentProcessingStep.java:138)
at dagger.internal.codegen.ComponentProcessingStep.process(ComponentProcessingStep.java:47)
at dagger.shaded.auto.common.BasicAnnotationProcessor.process(BasicAnnotationProcessor.java:330)
at dagger.shaded.auto.common.BasicAnnotationProcessor.process(BasicAnnotationProcessor.java:181)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:968)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:884)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$2200(JavacProcessingEnvironment.java:108)
at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1204)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1313)
at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1267)
at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:943)
at com.sun.tools.javac.api.JavacTaskImpl.lambda$doCall$0(JavacTaskImpl.java:100)
at com.sun.tools.javac.api.JavacTaskImpl.handleExceptions(JavacTaskImpl.java:142)
... 68 more
Hm, those overloads were added 3 months ago - what version of ErrorProne are you using? Can you spit out any relevant dependency tree info?
This only happens with error prone
You can reproduce with https://github.com/natros/dagger-error-prone-bug
Somewhere there's an old version of Guava that's being pushed on the annotation processor path. If I manually add this to the pom, the build succeeds:
<artifactId>error_prone_core</artifactId>
<version>2.1.1</version>
</dependency>
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ <version>23.6-jre</version>
+ </dependency>
</dependencies>
I don't think there's anything else to do here, but if I'm wrong please comment and we can reopen.
Looked into this some more. Bumping the version of Dagger 2 from 2.13 to 2.14.1 breaks when used in conjunction with the gradle-errorprone-plugin (v0.0.10). I had trouble reproducing locally at first, because I was omitting a flag that we set on CI which "applies" the gradle-errorprone-plugin.
Confirming @ronshapiro's comment above, forcing Guava to 23.6-jre with the following snippet works:
if (details.requested.group == 'com.google.guava') {
details.useVersion '23.6-jre'
}
When I diff my app dependencies with and without applying the errorprone-gradle-plugin on Dagger 2.13, then diff again (w/wo plugin) after bumping to Dagger 2.14.1, then diff _those_ results, I get:
9,14c9
< < | \--- com.google.guava:guava:21.0 -> 23.6-jre
< < | +--- com.google.code.findbugs:jsr305:1.3.9 -> 3.0.0
< < | +--- org.checkerframework:checker-compat-qual:2.0.0
< < | +--- com.google.errorprone:error_prone_annotations:2.1.3 -> 2.0.21
< < | +--- com.google.j2objc:j2objc-annotations:1.1
< < | \--- org.codehaus.mojo:animal-sniffer-annotations:1.14
---
> < | \--- com.google.guava:guava:21.0
26c21
< < +--- com.google.guava:guava:21.0 -> 23.6-jre (*)
---
> < +--- com.google.guava:guava:21.0
28c23
< < | \--- com.google.guava:guava:19.0 -> 23.6-jre (*)
---
> < | \--- com.google.guava:guava:19.0 -> 21.0
However, Guava 19.0, 21.0 and 23.6-jre all have the same method declaration in Verify.java, i.e.,
verify(boolean expression, String errorMessageTemplate, @Object... errorMessageArgs)
One thing worth noting (since forcing Guava 23.6-jre works): the nullable annotations applied to this method signature changed from 23.5 to 23.6 in this commit: https://github.com/google/guava/commit/6f22af40e1526b8c194e9e36d457bcd37680c6a3
Could that be related?
Could be related to https://github.com/google/error-prone/issues/482 then
Most helpful comment
Looked into this some more. Bumping the version of Dagger 2 from 2.13 to 2.14.1 breaks when used in conjunction with the gradle-errorprone-plugin (v0.0.10). I had trouble reproducing locally at first, because I was omitting a flag that we set on CI which "applies" the gradle-errorprone-plugin.
Confirming @ronshapiro's comment above, forcing Guava to 23.6-jre with the following snippet works:
When I diff my app dependencies with and without applying the errorprone-gradle-plugin on Dagger 2.13, then diff again (w/wo plugin) after bumping to Dagger 2.14.1, then diff _those_ results, I get:
However, Guava 19.0, 21.0 and 23.6-jre all have the same method declaration in Verify.java, i.e.,
One thing worth noting (since forcing Guava 23.6-jre works): the nullable annotations applied to this method signature changed from 23.5 to 23.6 in this commit: https://github.com/google/guava/commit/6f22af40e1526b8c194e9e36d457bcd37680c6a3
Could that be related?