-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update of different dependency: Error "package javax.annotation.processing is not visible" #4321
Comments
Dagger tries to find if the Generated annotation is on the class path and then outputs that if it is there, so there is probably some change there between the upgrading the versions that made it visible to the us? https://github.com/google/dagger/blob/master/java/dagger/internal/codegen/base/SourceFileGenerator.java#L81 which uses https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/ksp/KspProcessingEnv.kt;l=173;drc=067ed409b9bc2dcc59b93c8e9ab8d092beeff3a5 (That's the KSP version. There's something similar for javac, but it is easier to see in the KSP version).
I'm not really that familiar with how the |
Does that mean the generated annotation was not present on the classpath before and now it is? I searched the web a little more and it might be related to the fact, that dagger uses https://github.com/google/auto, which uses guava in turn. By updateing to the latest guava, there might have a been difference classpath order. Also found https://stackoverflow.com/a/53187201, which explains a little the annotation search and #1449 which might be related.
My bad, this is not a fix in Dagger, this fix applies to an affected project. 😅 I updated the my opening comment. |
Yup I think so.
Ah cool, thanks! Let me know if there's anything needed then in Dagger, otherwise I think this issue could probably be closed? |
I think so too. 🙃 |
In our project cryptomator/cryptofs, we use Dagger and also Google Guava.
When we update Google Guava from 33.0.0-jre to 33.1.0-jre, compilation fails with the error "package javax.annotation.processing is not visible". Looking into the error, only Dagger generated classes are affected, because by this external update, suddenly Dagger adds to every generated class the following annotation:
Prior to the dependency update, only the
@DaggerGenerated
annotation was present. I found #1339, but the project has already language level 17 as release target.The fix inside an affected project is simple(add
java.compiler
to the module-info.java), but I'm wondering, how the change of an external dependency leads to a different generated source of dagger.The text was updated successfully, but these errors were encountered: