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.

Better Error Warning when using private attributes in EpoxyModel

See original GitHub issue

Hi there,

I wrote some attributes with the private modifier @EpoxyAttribute private lateinit var htmlText: String (conditioned reflex, my bad) and I had a weird error that took me way too much time to link to the private modifier. I don’t know if it’s possible to verify this and display a better error than: <identifier> expected and not a statement. I was searching an eventual conflict in my gradle or a problem in kapt.

screenshot 2018-01-15 17 14 26 screenshot 2018-01-15 17 14 06

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
elihartcommented, Jan 18, 2018

Fix https://github.com/airbnb/epoxy/pull/388

The main issue was that since we didn’t have the name of the setter/getter we used “null” which made the generated code all messed up. The fix is simple. It switches the field to be accessed directly like super.html = html. This will give an error that html is private and can’t be accessed, but it is much clearer.

0reactions
elihartcommented, Jan 18, 2018

Good analysis. The reason we still try to generate code even though we log this error is that without generating the code there is the possibility for hundreds of more errors where referenced generated files don’t exist, and that makes it even harder to find the original issue.

I will try to clean up the code generated in this case.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Epoxy updating the epoxy attributes in the models once they ...
Problem. I'm not the Epoxy expert, but Epoxy models are required to be not modified after they were added to the controller.
Read more >
Epoxy for Android - Airbnb Engineering & Data Science
Epoxy is an Android library for building complex screens in a RecyclerView. It abstracts the boilerplate of view holders, item types, item ids,...
Read more >
How to build your complex UI with Epoxy - Factory.dev
Epoxy, tell me more about it; I am in, show me an example; Add dependencies to Library; ViewHolders bye, EpoxyModels hi; Create a...
Read more >
How does Airbnb do it? Epoxy! - Medium
Let's now create our Epoxy models. This will include the use of Epoxy annotations and attributes. The annotations function as an abstraction of...
Read more >
How to use Epoxy with ViewHolder (Part 2) - Iqbal Ahmed
Listing with ViewHolder is similar like Recycler. ... class KotlinEpoxyHolder that we can get from epoxy sample or from our source code.
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