-
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
java.lang.IllegalArgumentException: Multiple entries with same key #4323
Comments
Hi, I suspect this is related to our new feature @LazyClassKey introduced in 2.51, which is used by @HiltViewModel. It might be similar issue to #4309, there is something changed in AGP that resulted in our obfuscation rule fails to function properly. To understand the real cause, there is a map of original class name to the obfuscated class name generated under app/build/ouputs/mapping, which can help you translate the stack trace. Please attach the non-obfuscated stack trace or a repro to help me further debug the issue, thanks! |
I've encountered the same issue. Adding the proguard rule mentioned in #4309 fixes the problem. |
Fyi, a potential fix is in #4331 , it will come with the next release. |
Do you know when we'll see this release? |
I'll try to get a release out today. I'm closing this for now, but please report back if you still see issues. Also, in the future you can feel free to test out fixes before they are released using the |
after update to version 2.52 the issue not fixed so i returned back to 2.50 |
@devMagics Thanks for the update. If you can get a deobfuscated stacktrace it may help narrow down the issue. |
how to reach a deobfuscated stacktrace? |
Either apply -dontobfuscate rule in your proguard file or if you build with gradle, there is a map of original class name to the obfuscated class name generated under app/build/ouputs/mapping, which can help you translate the stack trace |
if i add -dontobfuscate in progaurd no issue found, after remove it and build signed app i get same issue
|
It would be helpful to know |
Instructions for de-obsufcating and debugging R8 can be found at https://developer.android.com/build/shrink-code#retracing |
This issue still not fixed with hilt 2.52. Hilt 2.52, AGP 8.6.0. For those who is facing this issue, add this on the pro-guard-rules
Will fix for sure! |
I'm experiencing the same. Here's the stack trace:
And I can confirm that both disabling obfuscation or this config work. |
Has this issue been confirmed? Can we expect it to be fixed in the upcoming release? |
Hi, we are working on a potential fix. At the meantime, can you try include
in the proguard rule and see if it helps? We are suspecting the shrinking rule is causing the class still being merged even though we used the keep rule. Thanks |
|
dagger version >=2.51, no issue in version 2.50
this error happen when enable Minify & shrinkResources, icant reach to original property or know how to debug it
the app crashed in first open
java.lang.IllegalArgumentException: Multiple entries with same key: W5.c=true and W5.c=true
at C7.L.a(SourceFile:45)
at B2.L.i(SourceFile:24)
at Z4.b.a(SourceFile:93)
at com.example.com.ui.screens.activity.Hilt_MainActivity.getDefaultViewModelProviderFactory(SourceFile:15)
at Ta.d.A(SourceFile:23)
at a.a.e(SourceFile:41)
at J5.a.invoke(SourceFile:171)
at h0.b.invoke(SourceFile:7)
at Z.d.a(SourceFile:229)
at ia.a.a(SourceFile:89)
at J5.a.invoke(SourceFile:137)
at h0.b.invoke(SourceFile:7)
at P.I.invoke(SourceFile:195)
at h0.b.invoke(SourceFile:7)
at Z.d.b(SourceFile:152)
at X.q2.a(SourceFile:129)
at J5.a.invoke(SourceFile:103)
at h0.b.invoke(SourceFile:7)
at Z.d.a(SourceFile:229)
at X.e3.a(SourceFile:79)
at A.L.invoke(SourceFile:396)
at h0.b.invoke(SourceFile:7)
at Z.d.b(SourceFile:152)
at X.Q0.h(SourceFile:353)
at i6.d.a(SourceFile:940)
at J5.a.invoke(SourceFile:41)
at h0.b.invoke(SourceFile:7)
at L0.q0.a(SourceFile:57)
at A.E.invoke(SourceFile:949)
at h0.b.invoke(SourceFile:7)
at Z.d.b(SourceFile:152)
at L0.r0.a(SourceFile:399)
at A.s0.invoke(SourceFile:473)
at h0.b.invoke(SourceFile:7)
at Z.d.b(SourceFile:152)
at L0.W.a(SourceFile:621)
at L0.z1.invoke(SourceFile:261)
at h0.b.invoke(SourceFile:7)
at Z.d.a(SourceFile:229)
at L0.z1.invoke(SourceFile:221)
at h0.b.invoke(SourceFile:7)
at Z.d.L(SourceFile:15)
at Z.s.p(SourceFile:203)
at Z.w.k(SourceFile:33)
at Z.q0.a(SourceFile:44)
at Z.w.l(SourceFile:9)
at Z.w.b(SourceFile:3)
at A.b.invoke(SourceFile:605)
at L0.y.setOnViewTreeOwnersAvailable(SourceFile:7)
at L0.A1.b(SourceFile:10)
at L0.A1.onStateChanged(SourceFile:19)
at androidx.lifecycle.x.a(SourceFile:23)
at androidx.lifecycle.y.a(SourceFile:216)
at A.b.invoke(SourceFile:574)
at L0.y.onAttachedToWindow(SourceFile:120)
at android.view.View.dispatchAttachedToWindow(View.java:21980)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3490)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3497)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3497)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3497)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3497)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3014)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2465)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:9305)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1339)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1348)
at android.view.Choreographer.doCallbacks(Choreographer.java:952)
at android.view.Choreographer.doFrame(Choreographer.java:882)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1322)
at android.os.Handler.handleCallback(Handler.java:958)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:205)
at android.os.Looper.loop(Looper.java:294)
at android.app.ActivityThread.main(ActivityThread.java:8177)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)
The text was updated successfully, but these errors were encountered: