android / codelab-android-navigation

Apache License 2.0
635 stars 275 forks source link

The application is crashing after updating on the newest version of navigation 2.3.3 #108

Open PetkevichPavel opened 3 years ago

PetkevichPavel commented 3 years ago

Hello, I'm using those dependencies: navigationVersion = 2.3.3

"navigationFragment"   : "androidx.navigation:navigation-fragment-ktx:$versions.navigationVersion",
"navigationUI"         : "androidx.navigation:navigation-ui-ktx:$versions.navigationVersion",
"navigationRuntimeKtx" : "androidx.navigation:navigation-runtime-ktx:$versions.navigationVersion"

The application is crashing, due to double call of arguments during the initialisation in viewModel block.

The behave is too strange, when the fragment launching the breakpoint triggering directly on the arguments but the arguments are empty, even if I saw that on previous step they were there, next step of the breakpoint is already correct and I see there my arguments, after I downgrade the version of the library everything comes to normal state.

override val viewModel: CameraQrViewModel by viewModel {
//First time arguments empty, next time withArgs....?
        arguments?.let {
            parametersOf(CameraQrFragmentArgs.fromBundle(it))
        } or parametersOf()
    }