auto-value-parcel icon indicating copy to clipboard operation
auto-value-parcel copied to clipboard

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

Open ratheeshcn opened this issue 4 years ago • 1 comments

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.

ratheeshcn avatar Sep 02 '20 08:09 ratheeshcn

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.

JakeWharton avatar Sep 02 '20 13:09 JakeWharton