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
Release build crash using 2.31-alpha #2291
Comments
Hmm, I'm not really sure what in Hilt could have caused this.
Does it only happen in proguarded builds? Any idea what the underlying cause of this is (e.g. is it that |
I wasn't clear. The release build finishes without error. It is when I start the app (the release version) that I get the crash. |
@peterLaurence |
Same issue here. |
@yshrsmz No, I don't have |
I got a same issue when release build. Added proguard rules and output logs.
|
@satoshun thanks for the deobfuscated error message, that helps a lot! @danysantiago was able to reproduce this locally and confirm the issue. However, I think the real issue is in r8. Hilt allows non-public entry points by generating a public wrapper for the entry point, e.g. // Hilt generates a public wrapper for PkgPrivateEntryPoint.
public interface HiltWrapper_PkgPrivateEntryPoint extends PkgPrivateEntryPoint {}
// The generated Hilt component extends the public wrapper
@Component(...)
interface HiltComponents_SingletonC extends HiltWrapper_PkgPrivateEntryPoint {} It sounds like this is a bug in r8 where it is incorrectly removing the wrapper during shrinking/optimization. We should file a bug for r8. In the meantime, you can try adding a keep rule for all EDIT: Looks like the keep rule may not be enough... we'll update once/if we've found a general solution. |
@satoshun For my own education, how did you generated a deobfuscated stacktrace? :) |
For anyone who wants the workaround, here is what i added to my proguard/r8 file.
|
@peterLaurence I use a
|
…ation issues. This CL is a partial rollback of changes made in CL/351213437 when introducing TestInstallIn. Making these classes pkg-private was mostly just a precaution. Making these public again should be fine since AggeregatedDepsProcessor prevents using TestInstallIn from replacing dagger.hilt modules. See #2291 RELNOTES=N/A PiperOrigin-RevId: 352903624
…r8 optimization issues. This CL is a partial rollback of changes made in CL/351213437 when introducing TestInstallIn. Making these classes pkg-private was mostly just a precaution. Making these public again should be fine since AggeregatedDepsProcessor prevents using TestInstallIn from replacing dagger.hilt modules. See #2291 RELNOTES=Partially Fixes 2291: Reverts Hilt internal entry point and modules back to public to avoid r8 optimization issues. The full fix on our side (until r8 bug is fixed) will be to ship a proguard config that keeps the HiltWrapper_ classes. This will be done in a future release. PiperOrigin-RevId: 352903624
…r8 optimization issues. This CL is a partial rollback of changes made in CL/351213437 when introducing TestInstallIn. Making these classes pkg-private was mostly just a precaution. Making these public again should be fine since AggeregatedDepsProcessor prevents using TestInstallIn from replacing dagger.hilt modules. See #2291 RELNOTES=Partially Fixes 2291: Reverts Hilt internal entry point and modules back to public to avoid r8 optimization issues. The full fix on our side (until r8 bug is fixed) will be to ship a proguard config that keeps the HiltWrapper_ classes. This will be done in a future release. PiperOrigin-RevId: 353064986
The immediate breakage caused by 2.31 has been reverted and pushed in 2.31.2. I will continue to leave this open though since the general issue still remains. |
Thanks for the quick solution. |
Hi, get the same issue. Here is the unscramble stack trace :
@peterLaurence : check this blogpost to unscramble stack trace : https://segunfamisa.com/posts/analyze-stack-trace-in-android-studio |
Hi @ColinAygalincSe,
|
@bcorso : it just the unscramble stack trace, hope it helps. Triggered with version 2.31-alpha. |
The underlying issue is https://issuetracker.google.com/178045782 which has been fixed in R8. Since that is done, and the immediate issue introduced by Hilt was fixed in 2.31.2, I'm closing this issue. |
@eugene-kirzhanov do you have a repro steps? Are you seeing the same issue as OP? Have you tried adding the obfuscation rules mentioned in #2291 (comment) ? We have not been able to repro this locally after updating the visibility in a2798a8. |
Sorry, my mistake - commented in another thread #2502 (but possibly related to this) |
For anyone hitting this with hilt 1.0.0:
did the trick for me ( |
Hi,
My release version runs just fine with
2.30.1-alpha
. However, with the new version, the release version fails (at app startup) with this stacktrace:Is there some proguard rule I should add?
The text was updated successfully, but these errors were encountered: