Android data binding error - java.lang.RuntimeException: view tag is invalid in view: null

Me and my teammate are working on the same project and
We are both using Android Studio 2.3 and Gradle 3.3
I have used dataBinding in my code and everything works correctly:
gradle:

...
android {
    ...
    dataBinding {
        enabled = true
    }
}
...

      

my_view.xml:

<layout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">

    <RelativeLayout>
          ....
     </RelativeLayout>
</layout>

      

MyClass.java:

public class MyClass extends Toolbar {
    private MyViewBinding binding;
    ...
    @Override
    protected void onFinishInflate() {
        super.onFinishInflate();
        initializeView();
    }

    private void initializeView() {
        this.binding = DataBindingUtil.inflate(LayoutInflater.from(getContext()), R.layout.my_view,this,  true);
        ...
    }
}

      

As I said, everything is working correctly for me, but for my teammate Android Studio is showing this error: android studio java.lang.RuntimeException: view tag isn't correct on view:null


Please can you tell us how we can fix this?

+3
android android-databinding


source to share


No one has answered this question yet

Check out similar questions:

1858
"Debug certificate expired" error in Android Eclipse plugins
1270
How to pass data between activities in an Android app?
815
Android "Only the original thread that created the view hierarchy can touch its views."
687
Android error: Failed to install * .apk on device *: timeout
684
How do I get crash data from my Android app?
672
How to get additional data from an intent on Android?
6
Android DataBinding, view tag is invalid in view: null
3
Android DataBinding - Invalid view tag: null
1
Android View subclass java.lang.RuntimeException: view tag incorrect in appearance: null
-1
LiveData does not notify UI about changes when used with DataBinding



All Articles
Loading...
X
Show
Funny
Dev
Pics