Error en data-binding-validator por Ilhasoft + Kotlin

Intento utilizar la biblioteca de Android "Validador de data binding de Ilhasoft" con Kotlin, pero obtengo este error: Referencia no resuelta: validar.

Esa es mi raíz build.gradle:

buildscript { ext.kotlin_version = '1.1.60' ext.android_plugin_version = '3.0.0' ext.data_binding_validator_verson = '1.0.0' repositories { jcenter() google() } dependencies { classpath 'com.android.tools.build:gradle:3.0.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } allprojects { repositories { jcenter() maven { url 'https://jitpack.io' } } } task clean(type: Delete) { delete rootProject.buildDir } 

Esa es mi APP build.gradle:

 apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-kapt' android { compileSdkVersion 27 buildToolsVersion "27.0.0" defaultConfig { applicationId "com.main.janderson.meuapp" minSdkVersion 16 targetSdkVersion 27 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" vectorDrawables.useSupportLibrary = true multiDexEnabled true } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } dataBinding { enabled = true } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version" kapt "com.android.databinding:compiler:$android_plugin_version" compile "com.github.Ilhasoft:data-binding-validator:$data_binding_validator_verson" } repositories { mavenCentral() google() } kapt { generateStubs = true } 

Ese es mi fragment_cadastrar_usuario:

 <?xml version="1.0" encoding="utf-8"?> <layout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> <data> <variable name="user" type="com.main.janderson.meuapp.model.User" /> </data> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin"> <ProgressBar android:id="@+id/cadastrar_user_progress" style="?android:attr/progressBarStyleLarge" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_marginBottom="@dimen/activity_vertical_margin" android:visibility="gone" /> <ScrollView android:layout_width="match_parent" android:layout_height="match_parent"> <LinearLayout android:id="@+id/cadastrar_form" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <android.support.design.widget.TextInputLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <EditText android:id="@+id/first_name_user" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="@string/first_name" android:inputType="textCapSentences" android:lines="1" android:maxLength="30" android:maxLines="1" android:text="@{user.firstName}" app:validateEmpty="@{false}" /> </android.support.design.widget.TextInputLayout> <android.support.design.widget.TextInputLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <EditText android:id="@+id/last_name_user" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="@string/last_name" android:inputType="textCapSentences" android:lines="1" android:maxLength="30" android:maxLines="1" android:text="@{user.lastName}" app:validateEmpty="@{false}" /> </android.support.design.widget.TextInputLayout> <android.support.design.widget.TextInputLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <EditText android:id="@+id/user_email" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="@string/prompt_email" android:inputType="textEmailAddress" android:lines="1" android:maxLength="100" android:maxLines="1" android:text="@{user.email}" app:validateType='@{"email"}' /> </android.support.design.widget.TextInputLayout> <android.support.design.widget.TextInputLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <EditText android:id="@+id/user_phone" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="@string/phone" android:inputType="phone" android:lines="1" android:maxLength="20" android:maxLines="1" android:text="@{user.phone}" /> </android.support.design.widget.TextInputLayout> <android.support.design.widget.TextInputLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <EditText android:id="@+id/user_pass" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="@string/prompt_password" android:inputType="textPassword" android:lines="1" android:maxLength="20" android:maxLines="1" android:text="@{user.password}" app:validateMinLength="@{4}" /> </android.support.design.widget.TextInputLayout> <android.support.design.widget.TextInputLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <EditText android:id="@+id/user_confir_pass" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="@string/prompt_repeat_password" android:imeActionLabel="@string/cadastrar" android:imeOptions="actionUnspecified" android:inputType="textPassword" android:lines="1" android:maxLength="20" android:maxLines="1" /> </android.support.design.widget.TextInputLayout> <Button android:id="@+id/new_user_button" style="?android:textAppearanceSmall" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="16dp" android:text="@string/cadastrar" android:textStyle="bold" /> </LinearLayout> </ScrollView> </LinearLayout> </layout> 

Y para terminar, es mi onCreateView en mi Fragmento:

 override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { val view = inflater.inflate(R.layout.fragment_cadastrar_user, null) //Binding Api val binding: FragmentCadastrarUserBinding = DataBindingUtil.setContentView(activity as Activity, R.layout.fragment_cadastrar_user) val validator = Validator(binding); binding.validate.setOnClickListener(View.OnClickListener { if (validator.validate()) { registerUser() } }) binding.setUser(user); view.user_phone.addTextChangedListener(PhoneNumberFormattingTextWatcher()) return view } 

Y para complementar esto, hay una image con mi error.

Puede alguien ayudarme con esto. ¡Gracias!

    validate es la identificación del button en el ejemplo de la biblioteca.

    Debe usar la identificación del button, en el que desea validar. Creo que es new_user_button .

    Entonces, con el enlace, debería ser como newUserButton .

    Entonces tu ejemplo completo será como:

     override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { val view = inflater.inflate(R.layout.fragment_cadastrar_user, null) //Binding Api val binding: FragmentCadastrarUserBinding = DataBindingUtil.setContentView(activity as Activity, R.layout.fragment_cadastrar_user) val validator = Validator(binding); // CHANGE IN BELOW LINE binding.newUserButton.setOnClickListener(View.OnClickListener { if (validator.validate()) { registerUser() } }) binding.setUser(user); view.user_phone.addTextChangedListener(PhoneNumberFormattingTextWatcher()) return view }