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.

lifecycleOwner property with databinding auto generated models

See original GitHub issue

Hi,

Thanks for this great library!

Having an issue after upgrading to Android Studio 3.1 which introduce the Android Architecture Components. If my layout includes another layout the setLifecycleOwner method is being overridden in the generated binding class and then being treated as an attribute. This is causing a build time exception while the generated (*Model_) class is trying to use BR.lifecycleOwner which doesn’t really exists.

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
elihartcommented, Apr 8, 2018

Thanks everybody that put up a fix. I have merged one and am pushing it in release 2.11.0 right now. Should be live in 30 minutes or so.

0reactions
Jack-Xiaocommented, Apr 6, 2018

I meet the same issue when upgrading to Android Studio 3.1

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bind layout views to Architecture Components
The Data Binding Library works seamlessly with ViewModel components, which expose the data that the layout observes and reacts to its changes.
Read more >
Android data binding : view does not update when property is ...
In case you might be experiencing this issue with LiveData , you might've forgotten to set lifecycle owner of your binding; binding.
Read more >
StateFlow with One- and TwoWay-DataBinding on Android
While continuing working with the View layer let's create a Fragment. The key components to make our app work with binding are creating...
Read more >
Advanced Data Binding in Android: Observables
You annotate areaCode with the Bindable annotation. This lets the Data Binding Library generate an entry for it in a class, BR.java. ·...
Read more >
Application Building Simplified With Data Binding - Innominds
This class holds all the bindings from the layout properties, i.e. the defined variable to the corresponding views. It also provides generated ......
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