https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
a

Adil

03/22/2024, 1:15 AM
can any one help me with the followings? 1. I am having issues with integrating parcelize even after gradle finishes sync and build still can't import the parcelize 2. lifecycle's states for some reason on KMM compose app just restarts my app when i put the app in the background from any screen but the behavior should have been to restore from the left screen i.e from screen i swipe it into the background.
b

Ben Abramovitch

03/22/2024, 1:18 AM
Are you by chance using Voyager for Screens/Navigation? If you're passing in things it can't serialize it would crash in the background/restart.
a

Adil

03/22/2024, 1:18 AM
Yes using Voyger for navigation
b

Ben Abramovitch

03/22/2024, 1:20 AM
There are a few posts about it on their github page like this one. https://github.com/adrielcafe/voyager/issues/340 I stopped passing constructor parameters into my screens. For the couple things I did need to get in I used CompositonLocal
a

Adil

03/22/2024, 1:22 AM
i ll try some of the workaround and see if it helps from the issue,Thanks👍
b

Ben Abramovitch

03/22/2024, 1:22 AM
Good luck
Also you can try marking all the constructor parameters as @Transient and see if it stops the crash. This caused some unexpected and undesirable behaviour for me and I didn't use it, but it should let you confirm that it stopped crashing?
a

Adil

03/22/2024, 2:10 AM
Thanks, the problem was this line "_rememberSaveable" changing it to_ remember fixed all the issues. (but i wanted some way to have the sate of the dropdown list to maintain it last selected value i.e property) var properties by rememberSaveable { _mutableStateOf_<ListProperty>(_emptyList_()) }
b

Ben Abramovitch

03/22/2024, 2:11 AM
Awesome 😃
🙌 1