-
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
Cannot invoke getAnnotationValue because "annotation" is null #4362
Comments
Hi @dgaillard2, are you able to reproduce this in a minimal repro example that you can share with us? |
Yes i created this minimal repo project : https://github.com/dgaillard2/hiltTest But sadly, i can't reproduce. What i have done in my project : removing all proguard rules but still have problem What i have done in this minimal repo project :
As i explain above, logs doesn't explain a lot, do someone have an idea how i can isolate the problem or have better logs ? I try --stacktrace or --info but it doesn't say much, "annotation is null" |
It s really weird because, it s specific to the upgrade of AGP from 8.3.2 to 8.4.2 8.3.2 -> no problems But .. On the minimal repro project i shared with u, there is no problem with the 8.4.2 AGP :') |
We can add additional information to the error message to tell you which element it is failing on. That information might help you narrow down possible causes of the issue and help you repro it. I'm out until next Thursday, but I can make the changes once I'm back. |
I appreciate, thanks :) |
Hello @bcorso, are you back ? |
… is missing. Users should never actually hit this error but we've seen some reports where a user hit this in #4362, so I've added information about the failing element to help the user further narrow down the issue. RELNOTES=N/A PiperOrigin-RevId: 658914140
Yep, I'm back. The information should be added once the PR above is submitted. You can use the |
… is missing. Users should never actually hit this error but we've seen some reports where a user hit this in #4362, so I've added information about the failing element to help the user further narrow down the issue. RELNOTES=N/A PiperOrigin-RevId: 658923031
Thanks, i will keep you in touch with next dagger release |
I upgrade to Dagger 2.52 and indeed i got more information :
This android module have got an hilt module (others android modules have hilt module too), but this one seems to be in error. After analyse, i don't understand why, as explain on the original post, all works before upgrade :) This hilt module of the error is like this :
There is one difference with others android modules, this proguard rules : -dontwarn java.lang.invoke.StringConcatFactory But this one seems mandatory for a library i'm using : minifyReleaseWithR8 : |
Hmm, can you find the If it is there in the generated source and you're still getting that error it means the annotation is getting stripped. Are you running proguard/r8 over the library separately from your application? |
Here it is :
Indeed AgreegatedDeps is there and i have define proguard inside the build.gradle.kts of this android module :
My application module have his own proguard :
Thanks |
Sorry @bcorso i don't understand, maybe we close it too fast, as explained i need inside my proguard module this line : -dontwarn java.lang.invoke.StringConcatFactory But with the new version of hilt, it s not possible to have this line ? How can i solve this ? |
I think @bcorso meant to link #4384 (comment) when he closed this. |
Ok thank you, i will remove minify from library module 👍🏻 |
It's strange, my project works well, but when i upgrade from my AGP like this :
from
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip com.android.tools.build:gradle 8.3.2
to
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip com.android.tools.build:gradle 8.4.2
i get this error in my project :
I'm using
com.google.dagger:hilt-compiler:2.49
and
com.google.dagger:hilt-android:2.49
I found this issue : #4241
What i tried :
com.google.dagger:dagger-producers
but it didn't resolve the problemIt happens on
hiltJavaCompilePreprodRelease
but it works onhiltJavaCompilePreprodDebug
Any idea why upgrading my AGP cause this problem ?
Thanks
The text was updated successfully, but these errors were encountered: