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
[Hilt] Release build crash in 2.33-beta #2502
Comments
Still reproducible in 2.34-beta Update: I've also tried to add -keepnames class dagger.hilt.** for proguard rules. Nothing changed. |
@eugene-kirzhanov, I have not been able to successfully reproduce this. Creating a new 'Basic Navigation' project in Android Studio with Hilt 2.34-beta and androidx.hilt 1.0.0-beta01 along with AGP 4.1.3. Enabling obfuscation and shinker seems fine too
If you could share a repro project that would greatly help us. Maybe you can you share your proguard configuration if its anything different from the default? When building an app there is also a few outputs related to the optimizations located in |
@danysantiago Unfortunately, I can't reproduce this issue with basic project, but it still exist in my project that is under NDA. I've tried to disable obfuscation (-dontobfuscate and -optimizations !code/allocation/variable) and I've got crash with the following stacktrace:
Also I've tried to enable debugging in release build, but I still couldn't find exact place of crash. However I found a proguard option that allows to start application without crash after adding it to the rules:
|
For #2291 we did two things:
During our investigation we also found out that using Related question: Which Android Gradle Plugin and Android Build Tools are you using in your project? (It tells us which R8 version is being used). |
@danysantiago I use Android Gradle Plugin 4.1.3 and Build Tools 30.0.3 I've just tried to use R8 2.2.51 and 2.2.60 (latest) without -allowaccessmodification and crash is gone. |
Ok, thx |
Closing as new R8 versions fixes this issue. |
A few days ago, My release version runs fine with 2.29.1-alpha.
Today, I update the new version, the crash occurred:
java.lang.IllegalAccessError: Interface dagger.hilt.android.internal.lifecycle.HiltViewModelFactory$ActivityCreatorEntryPoint implemented by class com.shenzhen.ukaka.module.app.App_HiltComponents$ActivityC is inaccessible (declaration of 'com.shenzhen.ukaka.module.app.App_HiltComponents$ActivityC' appears in /data/app/com.shenzhen.ukaka-SqpogQviDkVkbAO0RJl8Vg==/base.apk!classes2.dex)
at com.shenzhen.ukaka.module.app.DaggerApp_HiltComponents_SingletonC$ActivityRetainedCImpl.activityComponentBuilder(SourceFile:1)
at dagger.hilt.android.internal.managers.ActivityComponentManager.a(SourceFile:7)
at dagger.hilt.android.internal.managers.ActivityComponentManager.generatedComponent(SourceFile:4)
at com.shenzhen.ukaka.module.login.Hilt_LoginActivity.generatedComponent(SourceFile:1)
at com.shenzhen.ukaka.module.login.Hilt_LoginActivity.o(SourceFile:3)
at com.shenzhen.ukaka.module.login.Hilt_LoginActivity$1.onContextAvailable(SourceFile:1)
at androidx.activity.contextaware.ContextAwareHelper.dispatchOnContextAvailable(SourceFile:3)
at androidx.activity.ComponentActivity.onCreate(SourceFile:2)
at androidx.fragment.app.FragmentActivity.onCreate(SourceFile:1)
at androidx.appcompat.app.AppCompatActivity.onCreate(SourceFile:4)
at com.shenzhen.ukaka.module.base.BaseActivity.onCreate(SourceFile:1)
at android.app.Activity.performCreate(Activity.java:7894)
at android.app.Activity.performCreate(Activity.java:7881)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1307)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3283)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3457)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2044)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:224)
at com.shenzhen.ukaka.util.Cockroach$1.run(SourceFile:1)
at android.os.Handler.handleCallback(Handler.java:914)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:224)
at android.app.ActivityThread.main(ActivityThread.java:7560)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
However, Lowering the version to 2.32 solved the problem
The text was updated successfully, but these errors were encountered: