You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After updating my project's hilt dependency to 2.39 last night, I noticed a build failure with the following stack trace. After investigating, it seemed as if this was an error with a method that is missing from the -android versions of guava. Looking into it a bit more, I noticed that in our project we had forced the guava dependency to an android specific flavor in resolutionStrategy in our build.gradle (first 28.2-android, then 31.0.1-android).
Eg:
configurations.all {
resolutionStrategy {
force("com.google.guava:guava:31.0.1-android") // this resolution strategy causes a build failure
}
}
Either rolling back to hilt 2.38.1 or removing the guava forced resolution strategy allowed the project to compile. I'm not sure if this is intended behavior (or if there is another workaround) but I wanted to highlight it just in case!
Versions:
android studio : Arctic Fox 2020.3.1
gradle plugin : 7.0.2
gradle : 7.0.2
Thank you!
Stack trace:
Caused by: com.sun.tools.javac.processing.AnnotationProcessingError: java.lang.NoSuchMethodError: 'java.util.stream.Collector com.google.common.collect.ImmutableSet.toImmutableSet()'
at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:992)
at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:896)
at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1222)
at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1335)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1258)
... 35 more
Caused by: java.lang.NoSuchMethodError: 'java.util.stream.Collector com.google.common.collect.ImmutableSet.toImmutableSet()'
at dagger.hilt.android.processor.internal.androidentrypoint.Generators.copySuppressAnnotations(Generators.java:160)
at dagger.hilt.android.processor.internal.androidentrypoint.InjectorEntryPointGenerator.generate(InjectorEntryPointGenerator.java:64)
at dagger.hilt.android.processor.internal.androidentrypoint.AndroidEntryPointProcessor.processEach(AndroidEntryPointProcessor.java:56)
at dagger.hilt.processor.internal.BaseProcessor.process(BaseProcessor.java:194)
at org.jetbrains.kotlin.kapt3.base.incremental.IncrementalProcessor.process(incrementalProcessors.kt:90)
at org.jetbrains.kotlin.kapt3.base.ProcessorWrapper.process(annotationProcessing.kt:175)
at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:980)
... 39 more
The text was updated successfully, but these errors were encountered:
In a follow-up, I'll look into why none of our METADATA or presubmit checks caught this and add a fix to prevent this in the future.
Fixes#2904
RELNOTES=Fix#2904: Change toImmutableSet to use DaggerStreams rather than Guava.
PiperOrigin-RevId: 400011572
After updating my project's hilt dependency to 2.39 last night, I noticed a build failure with the following stack trace. After investigating, it seemed as if this was an error with a method that is missing from the
-android
versions of guava. Looking into it a bit more, I noticed that in our project we had forced the guava dependency to an android specific flavor inresolutionStrategy
in our build.gradle (first28.2-android
, then31.0.1-android
).Eg:
Either rolling back to hilt 2.38.1 or removing the guava forced resolution strategy allowed the project to compile. I'm not sure if this is intended behavior (or if there is another workaround) but I wanted to highlight it just in case!
I created a small repro project as well to show the build failure: https://drive.google.com/file/d/1y8qEc2Yk7T6buoCPCdmhej7DjhUb9jvK/view?usp=sharing
Versions:
android studio : Arctic Fox 2020.3.1
gradle plugin : 7.0.2
gradle : 7.0.2
Thank you!
Stack trace:
The text was updated successfully, but these errors were encountered: