2

I've recently cloned an old project and to my surprise 2 fragments had issues with data binding.

1. As you can see on the picture: Ive declared the binding variable(34), and initialized it accordingly(46). enter image description here

2. As seen on this function, some views are not recognized and some are. enter image description here

The code works, the app compiles, but the IDE doesn't seem to recognize some of the views on my XML file.

Here's what I have tried so far

  1. Disable data binding by setting it to false and Re-enabling it.
  2. Changing the name of the XML file in order to get a different DataType on my binding variable.
  3. Changing the name of the view on Kotlin side, which ended up signaling an error because then data binding couldn't find it on the XML side.
  4. Ask for help on StackOverflow.

PS: After doing the steps above I've Invalidated the cache and restarted the IDE

Doilio Matsinhe
  • 2,131
  • 16
  • 29

1 Answers1

0

Probably (my opinion), the first time you compiled the project, inside the xml file you had some views that had another id (recyclerCast, recyclerTrailer and recyclerReview you had called them with another name) while other views you did not rename them (textview6 ) In fact, the dataBinding "sees" you only textview6. In theory if you do a 'Clean Project' and after a 'Rebuild Project' the FragmentTvSeriesDetailsBinding class should recognize the new names you have given to the views

Adamo Branz
  • 164
  • 2
  • 7