rharter / auto-value-parcel

An Android Parcelable extension for Google's AutoValue.
Apache License 2.0
655 stars 64 forks source link

error: Maps can only have String objects for keys and valid Parcelable types for values. #153

Open ratheeshcn opened 4 years ago

ratheeshcn commented 4 years ago

Here is my declaration

 @SerializedName("extra_data")
    public abstract  @Nullable Map<String, JsonElement> storeExtraData();

error: Maps can only have String objects for keys and valid Parcelable types for values.

can somebody share how we can handle this error on build.

JakeWharton commented 4 years ago

JsonElement is not Parcelable or Serializable and thus cannot be used. You'll have to wrap it into something that can be parceled or serialized.