Open alexluque opened 3 years ago
Hi! Can you show project code where I can debug this problem? Small reproducer will be good
Hi Alex. Thank You so much for your rapid response.
Please, use this link from WeTransfer to download a Sample project which tries to reproduce as close as possible the configuration files that we have in our real project, as well as the navigation performed when the register button is clicked.
I've been setting up this project very quick. I hope you find everything you might need in order to reproduce the problem and to debug it accordingly. Excuse me for not providing you a valid test case. I had very little time to set up this project.
We are using Android Studio Preview Artic Fox Canary 2 for these projects.
Steps to reproduce the error:
Thank you for your time.
did you use addObserver
with lifecycle (from android architecture livedata) or without lifecycle? if you not pass lifecycle - you should control lifecycle by self and removeObserver when component life end.
We are using the latest version of Moko-MVVM at the time of this writing: 0.9.1. We have a Fragment which uses Jetpack's Navigation.
If we perform a screen rotation in Android and then we click on the button which performs the navigation the IllegalStateException occurs. It seems that the ViewModel is not properly reattached after rotation.
We've been checking and updating dependencies versions before submitting this ticket and we also replaced the Moko ViewModel by a pure Android ViewModel instance, in order to isolate the problem and to verify that the problem is actually related to this library.
Here's the stack trace:
I'll be glad to provide any further information that you might need in order to check this problem out.