replace
android.support.design.widget.TextInputLayout
with
com.google.android.material.textfield.TextInputLayout
If you uses AndroidStudio, you should not include android-support-design.jar.
Instead, write like below in your build.gradle:
dependencies {
...
compile 'com.android.support:design:24.0.0'
...
}
Edit: If this doesn’t work you are probably using a different version. In Windows, go to:
[android-sdk]extrasandroidm2repositorycomandroidsupportdesign
On Mac:
sdk/extras/android/m2repository/com/android/support/design
This directory holds a number of version folders. Use the latest version on your build.gradle.
add in the build.gradle following this line:
implementation 'com.android.support:design:28.0.0'
and use in the xml file:
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/inputLayoutMobile"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dimen_20dp"
android:layout_marginRight="@dimen/dimen_20dp"
android:hint="@string/phone_number"
android:visibility="gone"
android.support.design:layout_constraintTop_toBottomOf="@+id/inputLayoutAppServerUrl">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/edtTxtMobile"
style="@style/Style_TextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableLeft="@drawable/ic_smartphone"
android:drawablePadding="@dimen/dimen_10dp"
android:inputType="number"
android:singleLine="true"
android:scrollbars="vertical"
android:text="@={SettingViewModel.mMobileNo}"
android:textSize="@dimen/font_13sp" />
</com.google.android.material.textfield.TextInputLayout>