user1209216
user1209216

Reputation: 7974

Android Studio 3.5 DataBinding BR fields shown as undefined

After upgrading to Android Studio 3.5, I'm always getting data binding errors in code editor:

enter image description here

Any autogenerated field inside BR is marked as red and non existent, but still project compiles fine. How can I fix that? Rebuild project, Invalidate Cache and restart, nothing helped.

Upvotes: 2

Views: 832

Answers (1)

nAkhmedov
nAkhmedov

Reputation: 3592

I think you are importing wrong BR class. I have changed my import from

import com.my.packagename.BR;

into

import androidx.databinding.library.baseAdapters.BR;

It is working fine, now. Enjoy coding...

Upvotes: 4

Related Questions