You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 16, 2023. It is now read-only.
Hi guys,
We had a RuntimeException while we put a safeArgs into the navigation graph and this crash didn't give us any more guide to fix it.
In the first impression, we were following this to ensure that those classes were Parcelize or not.
Although, we found our SafeArgs class exists in a sealed-class file. Considering to this point that we can't allocate the parceled annotation to the sealed classes, we've decided to move our class outside of that sealed .kt file.
After many searches and investigations into our codes, I found the main reason for that runtime crash was this cause.
Also, I've provided the wrong and correct cases below, We hope this will be helpful to others:
We've moved the UserFavorite and its subclass, outside of the Response.kt file,
sealed class Response {
.
.
@Parcelize
data class UserFavorite(
@SerializedName("title") val title: String,
@SerializedName("itemType") val itemType: String,
@SerializedName("emptyIcon") val emptyIcon: String,
@SerializedName("_texts") val texts: UserFavoriteTexts
) : Response(), Parcelable
@Parcelize
data class UserFavoriteTexts(
@SerializedName("hintMessage") val hintMessage: String,
@SerializedName("add") val add: String,
@SerializedName("remove") val remove: String,
@SerializedName("edit") val edit: String
): Parcelable
.
.
}
into an independent file for that: UserFavorite.kt
@Parcelize
data class UserFavorite(
@SerializedName("title") val title: String,
@SerializedName("itemType") val itemType: String,
@SerializedName("emptyIcon") val emptyIcon: String,
@SerializedName("_texts") val texts: UserFavoriteTexts
) : Response(), Parcelable
@Parcelize
data class UserFavoriteTexts(
@SerializedName("hintMessage") val hintMessage: String,
@SerializedName("add") val add: String,
@SerializedName("remove") val remove: String,
@SerializedName("edit") val edit: String
): Parcelable
and, Respons.kt
sealed class Response {
.
.
.
.
}
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi guys,
We had a RuntimeException while we put a safeArgs into the navigation graph and this crash didn't give us any more guide to fix it.
In the first impression, we were following this to ensure that those classes were Parcelize or not.
Although, we found our SafeArgs class exists in a sealed-class file. Considering to this point that we can't allocate the parceled annotation to the sealed classes, we've decided to move our class outside of that sealed .kt file.
After many searches and investigations into our codes, I found the main reason for that runtime crash was this cause.
Also, I've provided the wrong and correct cases below, We hope this will be helpful to others:
We've moved the UserFavorite and its subclass, outside of the Response.kt file,
into an independent file for that: UserFavorite.kt
and, Respons.kt
The text was updated successfully, but these errors were encountered: