-
Hello, starting my journey with Android (and KMP!) and I am using a bunch of different libraries. Right now I'm trying to integrate two of them but I am running into an exception and involving these libraries and I am not sure how to go about it. Obviously voyager is one of them and the other is multiplatform-settings I am creating a login screen and when I log in, I want to call an API and store some user settings from the API into the datastore using multiplatform-settings, with their FlowSettings API. There does not be an easy way to use dependency injection with multiplatform-settings (due to it needing platform specific context) so I am passing it along through the data class LoginScreen (private val settings: FlowSettings) : Screen {
@Composable
override fun Content() {
...
}
} The issue is that sometimes (mostly when I close the app via backpress) I get this error Here's the full stacktrace
As you can see the issue is with serializing My question, is there anyway to avoid this in voyager? Is there a recommended way to pass along objects that you can't modify yourself and isn't serializable by default? I could not find anything in the documentation and the other issues I noticed that involved the same exception isn't an exact mirror to my situation. And of course if I am doing this incorrectly, please feel free to give me any advice, I am a complete novice in Android Development Thanks for the help! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
You are either meant to use a DI solution like Kodein or Koin, or pass these types of objects using Composition Locals |
Beta Was this translation helpful? Give feedback.
You are either meant to use a DI solution like Kodein or Koin, or pass these types of objects using Composition Locals