codelab-android-navigation icon indicating copy to clipboard operation
codelab-android-navigation copied to clipboard

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

Open PetkevichPavel opened this issue 4 years ago • 0 comments

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()
    }

PetkevichPavel avatar Mar 11 '21 12:03 PetkevichPavel