Hello, I have the following issue with state prese...
# decompose
p
Hello, I have the following issue with state preservation on iOS. The app fails at runtime with the error below (full trace in the thread)
Copy code
kfun:kotlin.Throwable#<init>(kotlin.String?){} + 123 
kfun:kotlin.Error#<init>(kotlin.String?){} + 119 
kfun:kotlin.NotImplementedError#<init>(kotlin.String){} + 119 
kfun:com.arkivanov.parcelize.darwin.NotImplementedCoding#objc:encodeWithCoder: + 219
when navigating from the app with some entries in the navigation stack, when the following method in
AppDelegate
is called
Copy code
func application(_ application: UIApplication, shouldSaveSecureApplicationState coder: NSCoder) -> Bool {
        let savedState = rootHolder!.stateKeeper.save()
        CodingKt.encodeParcelable(coder, value: savedState, key: "savedState")
        return true
    }
I’m using Essenty 1.1.0, parcelize-darwin plugin 0.1.4. What might be the cause of it?
1
full trace.txt
a
Glad you are trying the state preservation on iOS! Have you applied the
parcelize-darwin
plugin? See the docs: https://arkivanov.github.io/Decompose/component/state-preservation/#darwin-apple-targets-support
p
Yes, the plugin is applied in the shared module and dependencies are exported to framework as follows
Copy code
export(libs.essenty.state.keeper)            export(libs.parcelize.darwin.runtime)
a
Unfortunately, the stack trace points to something like
knbridge3
which doesn't provide any useful information. It looks like the plugin is not applied in the module where that
Parcelable
class is located, or
@Parcelize
annotation is not added on that class, or the compiler plugin failed to discover that class.
p
Thanks, this seems to be the issue
a
Please let me know what the issue was. Could be useful in the future.
p
The
Parcelable
class was located not in the module where parcelize-darwin plugin was applied