Closed lawrencebautista closed 6 years ago
Changing @EpoxyAttribute var quickLinks: List<QuickLink> = listOf()
to @EpoxyAttribute var quickLinks: ArrayList<QuickLink> = ArrayList()
fixes it.
Can anyone explain what's going on?
Looks like declaring the field as a generic List in Kotlin will generate a setter with set(List<? extends QuickLink> quickLinks)
which the annotation processor does not recognize.
The workaround is to use the @JvmSuppressWildcards
annotation. for example: @EpoxyAttribute var quickLinks: List<@JvmSuppressWildcards QuickLink> = listOf()
I wonder if the annotation processor can be changed to not require this?
Thanks for digging into this. The annotation processor should be able to handle wild cards. I'll try to get around to it soon, but thanks for posting the workaround in the meantime.
@lawrencebautista why close this? if you want the change made you can leave it open until it actually happens so we can track it
Fixed with https://github.com/airbnb/epoxy/pull/451
Hi, this is driving me crazy. I can't seem to build my app because I get the following exception:
e: error: Epoxy Processor Exception: EpoxyAttribute annotations must not be on private fields without proper getter and setter methods. (class: HomeQuickLinksModel, field: quickLinks)
Here is the model class:
From what I understand, Kotlin should be generating the getters and setters for the quickLinks field. I verified this by trying to call them from java code. But the processor still doesn't like it! I am using epoxy version 2.10.0