terrakok/Cicerone

Crash in version 7.1

robertlevonyan opened this issue · 4 comments

atal Exception: java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
       at androidx.fragment.app.FragmentManager.checkStateLoss(FragmentManager.java:1)
       at androidx.fragment.app.BackStackRecord.commitInternal(BackStackRecord.java:4)
       at androidx.fragment.app.BackStackRecord.commit(BackStackRecord.java:1)
       at com.github.terrakok.cicerone.androidx.AppNavigator.commitNewFragmentScreen(AppNavigator.java:9)
       at com.github.terrakok.cicerone.androidx.AppNavigator.replace(AppNavigator.java:5)
       at com.github.terrakok.cicerone.androidx.AppNavigator.applyCommands(AppNavigator.java:7)
       at com.robertlevonyan.testy.ui.main.MainFragment.onItemSelected$lambda-10$lambda-9(MainFragment.java:53)
       at androidx.camera.camera2.internal.Camera2CameraControlImpl$CameraCaptureCallbackSet$$InternalSyntheticLambda$9$e5350c1b11be8bdf6a3182cb638daed28e6e5f26d5bae717586c49615918254f$0.run$bridge(Camera2CameraControlImpl.java:53)
       at android.os.Handler.handleCallback(Handler.java:938)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loop(Looper.java:236)
       at android.app.ActivityThread.main(ActivityThread.java:8059)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:656)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967)
lyrjie commented

@terrakok , hello
Is there a current maintainer for the library? There haven't been any work in last two years and critical issues like this one are left without a comment for more than a year
Could you please mark the repository as unsupported / deprecated, if it's an orphan

Hello! I'm here and there are no contributions for two reasons:

  1. the reported one is not a library issue but a FragmentManager behavior which was discussed lots of times.
  2. library is stable enough at the moment. and since Compose for Android is recommended way to make applications, I don't have ideas to develop the library

If you have ideas PRs are more than welcome!

Regarding the issue: #160

@VitalyPeryatin may add a comment here, I guess.

lyrjie commented

This current issue is reproducible on 7.1
As far as I understand the comment, it assumes the Router is cleared in onPause; which is an assumation on the user's app architecture. Meanwhile, I've seen some developers inject Router directly into, for example, presenter, meaning there's no onPause handling. It's, of course, for you to decide whether to support such a usage or not

Thanks for the prompt answer!

This current issue is reproducible on 7.1 As far as I understand the comment, it assumes the Router is cleared in onPause; which is an assumation on the user's app architecture. Meanwhile, I've seen some developers inject Router directly into, for example, presenter, meaning there's no onPause handling. It's, of course, for you to decide whether to support such a usage or not

Thanks for the prompt answer!

That's a bug on library user's part, they should observe ProcessLifecycleOwner to know attach/detach of the app itself if they don't control the NavigationHolder otherwise from Fragment lifecycle.