Tag: deserialization

与gson的Kotlin parcelize问题

我正在使用@parcelize for gson 这是我的class @Parcelize data class CommunityModel(@SerializedName(“post”) val post: PostModel, @SerializedName(“is_liked”) val isLiked: Boolean, @SerializedName(“post_like”) val postLike: QuestionModel, @SerializedName(“polling_options”) val pollingOptions: List, @SerializedName(“post_polled”) val postPolled: Boolean) : Parcelable 我得到错误Unable to invoke no-args constructor for class. Register an InstanceCreator with Gson for this type may fix this problem. Unable to invoke no-args constructor for class. […]