org.parceler.Parcel: No corresponding property found for constructor parameter when constructor contains boolean fields

431 views Asked by At

I meet first time with this problem. I noticed that above exception is throw when @ParcelConstructor contains boolean fields. Maybe have you got any solutions to put in boolean values to constructor Regards Shogun

1

There are 1 answers

0
Cody On

In this case, you need to add @ParcelProperty.

One example:

@Parcel(Parcel.Serialization.BEAN)
private data class Model @ParcelConstructor constructor(
    @ParcelProperty("valid") val isValid: Boolean
)