question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Kotlin Epoxy Processor Exception

See original GitHub issue

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:

@EpoxyModelClass(layout = R.layout.quick_links_expanded_layout)
abstract class HomeQuickLinksModel :
    EpoxyModelWithHolder<HomeQuickLinksModel.Holder>() {

    class Holder : EpoxyHolder() {
        var recyclerView: RecyclerView? = null
        var itemView: View? = null

        override fun bindView(itemView: View) {
            recyclerView = itemView.quick_links_recycler_view
            this.itemView = itemView
        }
    }

    @EpoxyAttribute var quickLinks: List<QuickLink> = listOf()
    ...

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

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
elihartcommented, May 15, 2018

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.

0reactions
elihartcommented, Jun 16, 2018
Read more comments on GitHub >

github_iconTop Results From Across the Web

Epoxy processor crashes when using Kotlin 1.4-M1 · Issue #956
I haven't debugged why yet. error: Epoxy Processor Exception: Caused by KotlinNullPointerException: null Stacktrace: com.airbnb.epoxy.
Read more >
Epoxy, Kotlin: Using @ModelView generates nothing with no ...
Epoxy, Kotlin: Using @ModelView generates nothing with no errors ... Epoxy Processor Exception: Unable to get layout resource for view ...
Read more >
Epoxy — A proxy for Adapter and complex view types! - Medium
TL;DR I will be running through on how AirbnbEng's Epoxy library helped me to bypass the need for adapters, view-holder classes, and the...
Read more >
How to use Epoxy in Android (Part 1) - Iqbal Ahmed
Here we need a helper class KotlinModel that we can get from epoxy sample or from our source code. abstract class KotlinModel( @LayoutRes ......
Read more >
[Solved]-Why Epoxy does not generate model class?-kotlin
One common mistake when using Epoxy in Kotlin is mixing annotation processing engines. If you copied this from Epoxy's readme:
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found