Itโs just that suddenly my Android bindings stopped working, everything that I am creating now, I just get this message.
Error: execution completed for task ': app: compileDevDebugJavaWithJavac'.
java.lang.RuntimeException: Data binding errors detected. **** / data binding error **** msg: Unable to find getter for attribute 'android: text' with value of type java.lang.String on android.widget.EditText. File: C: \ path \ to \ layouts \ layout.xml loc: 85: 12 - 96:54 **** \ data transfer error ****
What i tried
At first it was suggested that the bindings should not be compiled if there were errors in my files, therefore all the layout files where I used the bindings to one file were deleted layout.xml. There I have
<EditText
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="@{model.name}" />
... and it works well, however, if I add a two-way binding android:text="@={model.name}"It gives the previous error.
Next , I add
@InverseBindingAdapter(attribute = "android:text")
public static String captureEditTextValue(EditText view) {
return view.getText().toString();
}
... then it gives a new error.
Error: execution completed for task ': app: compileDevDebugJavaWithJavac'.
java.lang.RuntimeException: Data binding errors detected. **** / data binding error **** msg: Could not find the event 'android: textAttrChanged' in the View field 'android.widget.EditText' File: C: \ Users \ EdgeTech \ AndroidStudioProjects \ wallet \ wallet-client \ application \ SRC \ main \ Res \ location \ get_phone_layout.xml loc: 85: 12 - 96:54 **** \ data transfer error ****
Went on to reorganize this
@InverseBindingAdapter(attribute = "android:text", event = "android:textAttrChanged")
public static String captureEditTextValue(EditText view) {
return view.getText().toString();
}
... still gives the previous error.
My setting
- Android Studio: 2.3.3
- Gradle Build Tools: 2.3.3