Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

android.os.BadParcelableException: Parcelable encountered IOException when screen is off #488

Open
hafiz013 opened this issue Sep 20, 2024 · 1 comment

Comments

@hafiz013
Copy link

sample edit screen:

class EditScreen(private val asset: AssetTable, private val categoryAsset: String,
                      private val typeOfAsset: String
):BasedActivityScreen() {
     @Preview
    @Composable
    override fun previewScreen() {
  }
}

abstract class BasedActivityScreen : Screen{
    @Composable
    override fun Content() {
        val navigator = LocalNavigator.currentOrThrow

        val sessionState: SessionState = koinInject()
        val sessionUiState by sessionState.isLoggedIn.collectAsState()

        if (!sessionUiState){
            LaunchedEffect(Unit){
                delay(3000)
                navigator.replace(LoginScreen())
            }
        }

        previewScreen()
    }

    @Preview
    @Composable
    open fun previewScreen(){}
}

Error:

Process: com.kloudius.katmaans, PID: 19238
android.os.BadParcelableException: Parcelable encountered IOException writing serializable object (name = com.sample.editScreen)
	at android.os.Parcel.writeSerializable(Parcel.java:2807)
	at android.os.Parcel.writeValue(Parcel.java:2573)
	at android.os.Parcel.writeValue(Parcel.java:2372)
	at android.os.Parcel.writeList(Parcel.java:1425)
	at android.os.Parcel.writeValue(Parcel.java:2516)
	at android.os.Parcel.writeValue(Parcel.java:2372)
	at android.os.Parcel.writeList(Parcel.java:1425)
	at android.os.Parcel.writeValue(Parcel.java:2516)
	at android.os.Parcel.writeValue(Parcel.java:2372)
	at android.os.Parcel.writeArrayMapInternal(Parcel.java:1308)
	at android.os.BaseBundle.writeToParcelInner(BaseBundle.java:1847)
	at android.os.Bundle.writeToParcel(Bundle.java:1389)
	at android.os.Parcel.writeBundle(Parcel.java:1377)
	at android.os.Parcel.writeValue(Parcel.java:2489)
	at android.os.Parcel.writeValue(Parcel.java:2379)
	at android.os.Parcel.writeArrayMapInternal(Parcel.java:1308)
	at android.os.BaseBundle.writeToParcelInner(BaseBundle.java:1847)
	at android.os.Bundle.writeToParcel(Bundle.java:1389)
	at android.os.Parcel.writeBundle(Parcel.java:1377)
	at android.os.Parcel.writeValue(Parcel.java:2489)
	at android.os.Parcel.writeValue(Parcel.java:2379)
	at android.os.BaseBundle.dumpStats(BaseBundle.java:1921)
	at android.os.BaseBundle.dumpStats(BaseBundle.java:1958)
	at android.app.servertransaction.PendingTransactionActions$StopInfo.collectBundleStates(PendingTransactionActions.java:123)
	at android.app.servertransaction.PendingTransactionActions$StopInfo.run(PendingTransactionActions.java:139)

library use:
voyager = "1.1.0-alpha04"

@comm1x
Copy link

comm1x commented Nov 16, 2024

Same for 1.1.0-beta03

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants