Assigned
Status Update
Comments
il...@google.com <il...@google.com> #2
I just attached a minimal test application with duplicated and multiline traces. Provided are a couple of logcat files and screenshots.
To me this isn'r really a big problem, since AS compiles my application and lets me debug it. That's what I use it for in my company. I just found it a bit annoying that something that worked one way in AS 2.x and 3.0, suddenly changed in 3.1. The new way results more time-consuming to me while debugging and reviewing the logs.
Could this be made configurable? Not necessarily in the UI, but editing some properties file. Thanks. :)
To me this isn'r really a big problem, since AS compiles my application and lets me debug it. That's what I use it for in my company. I just found it a bit annoying that something that worked one way in AS 2.x and 3.0, suddenly changed in 3.1. The new way results more time-consuming to me while debugging and reviewing the logs.
Could this be made configurable? Not necessarily in the UI, but editing some properties file. Thanks. :)
ac...@google.com <ac...@google.com>
[Deleted User] <[Deleted User]> #4
I also have the same problem.
sg...@google.com <sg...@google.com> #5
I also have the same problem.
[Deleted User] <[Deleted User]> #6
I also have the same problem.
sg...@google.com <sg...@google.com> #7
I also have the same problem.
[Deleted User] <[Deleted User]> #8
Was it fixed reverting to the old behavior, or was it fixed making the deduplication configurable?
What release version will include the fix?
What release version will include the fix?
Description
Hilt
KSP
Fragment KTX
Activity KTX
ViewModels
viewModels() delegate
R8 -> proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
Version used:
Hilt -> 2.51.1
KSP -> 2.0.0-1.0.21
Fragment KTX -> 1.6.0-alpha03
Activity KTX -> 1.7.0-alpha01
Devices/Android versions reproduced on:
Android Emulators & Samsung A03
Brief explanation:
While we run our app´s release build type which has the already mentioned R8 config, hilt builts the proper ViewModel Providers, then the following crash appears (de-obfuscated code):
Fatal Exception: java.lang.IllegalArgumentException: Multiple entries with same key: Ma.v=true and Ma.v=true
at com.google.common.collect.ImmutableMap$Builder$DuplicateKey.java.lang.IllegalArgumentException exception()(SourceFile:45)
at com.google.crypto.tink.subtle.prf.HkdfStreamingPrf.com.google.common.collect.ImmutableMap com.google.common.collect.ImmutableMap$Builder.build(boolean)(SourceFile:433)
com.google.common.collect.ImmutableMap com.google.common.collect.ImmutableMap$Builder.buildOrThrow()
at com.xxx.mobile.DaggerxxxMobileApplication_HiltComponents_SingletonC$ActivityCImpl.com.google.common.collect.ImmutableMap com.google.common.collect.ImmutableMap$Builder.build()(SourceFile:296)
java.util.Map getViewModelKeys()
at com.google.android.gms.internal.mlkit_vision_barcode.zzef.dagger.hilt.android.internal.lifecycle.DefaultViewModelFactories$InternalFactoryFactory com.xxx.mobile.DaggerxxxMobileApplication_HiltComponents_SingletonC$ActivityCImpl.getHiltInternalFactoryFactory()(SourceFile:13)
dagger.hilt.android.internal.lifecycle.DefaultViewModelFactories$InternalFactoryFactory com.xxx.mobile.DaggerxxxMobileApplication_HiltComponents_SingletonC$FragmentCImpl.getHiltInternalFactoryFactory()
androidx.lifecycle.ViewModelProvider$Factory dagger.hilt.android.internal.lifecycle.DefaultViewModelFactories.getFragmentFactory(androidx.fragment.app.Fragment,androidx.lifecycle.ViewModelProvider$Factory)
at com.xxx.mobile.splash.SplashFragment.androidx.lifecycle.ViewModelProvider$Factory com.xxx.mobile.splash.Hilt_SplashFragment.getDefaultViewModelProviderFactory()(SourceFile:5)
at com.xxx.mobile.login.tenant.TenantFragment$special$$inlined$viewModels$default$10.androidx.lifecycle.ViewModelProvider$Factory com.xxx.mobile.splash.SplashFragment$special$$inlined$viewModels$default$5.invoke()(SourceFile:132)
java.lang.Object com.xxx.mobile.splash.SplashFragment$special$$inlined$viewModels$default$5.invoke()
at com.xxx.mobile.support.database.dao.BrandsDAO_Impl.androidx.lifecycle.ViewModel androidx.lifecycle.ViewModelLazy.getValue()(SourceFile:21)
java.lang.Object androidx.lifecycle.ViewModelLazy.getValue()
at com.xxx.mobile.splash.SplashFragment.com.xxx.mobile.splash.SettingsViewModel getViewModel()(SourceFile:11)
void onViewCreated(android.view.View,android.os.Bundle)
at androidx.fragment.app.Fragment.void performViewCreated()(SourceFile:15)
at androidx.fragment.app.FragmentStateManager.void createView()(SourceFile:299)
at androidx.fragment.app.FragmentStateManager.void moveToExpectedState()(SourceFile:175)
at androidx.fragment.app.FragmentManager.void executeOpsTogether(java.util.ArrayList,java.util.ArrayList,int,int)(SourceFile:1166)
at androidx.fragment.app.FragmentManager.void removeRedundantOperationsAndExecute(java.util.ArrayList,java.util.ArrayList)(SourceFile:82)
at androidx.fragment.app.FragmentManager.boolean execPendingActions(boolean)(SourceFile:78)
at androidx.fragment.app.FragmentManager.void dispatchStateChange(int)(SourceFile:65)
at androidx.fragment.app.FragmentActivity.void androidx.fragment.app.FragmentManager.dispatchActivityCreated()(SourceFile:34)
void androidx.fragment.app.FragmentController.dispatchActivityCreated()
void onStart()
at androidx.appcompat.app.AppCompatActivity.void onStart()(SourceFile:1)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1701)
at android.app.Activity.performStart(Activity.java:9023)
at android.app.ActivityThread.handleStartActivity(ActivityThread.java:4072)
at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:270)
at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:250)
at android.app.servertransaction.TransactionExecutor.executeLifecycleItem(TransactionExecutor.java:222)
at android.app.servertransaction.TransactionExecutor.executeTransactionItems(TransactionExecutor.java:107)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:81)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2635)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loopOnce(Looper.java:232)
at android.os.Looper.loop(Looper.java:317)
at android.app.ActivityThread.main(ActivityThread.java:8699)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:886)
we´d tried with check whether it's the dependencies that a View Model takes, the type, but it doesn´t matter
also providing a custom factory solves the issue.
Anything else we can provide let us know.
Thank you.