I am getting error while try to use TextInputLayout in android
I have android support library version 23. but still getting error
my xml file showing error is
he following classes could not be instantiated:
- android.support.design.widget.TextInputLayout (Open Class, Show Error Log)
See the Error Log (Window > Show View) for more details.
11-25 00:58:30.967: E/AndroidRuntime(27848): Caused by: java.lang.IllegalArgumentException: You need to use a Theme.AppCompat theme (or descendant) with the design library.
11-25 00:58:30.967: E/AndroidRuntime(27848): at android.support.design.widget.ThemeUtils.checkAppCompatTheme(ThemeUtils.java:34)
11-25 00:58:30.967: E/AndroidRuntime(27848): at android.support.design.widget.TextInputLayout.<init>(TextInputLayout.java:103)
11-25 00:58:30.967: E/AndroidRuntime(27848): at android.support.design.widget.TextInputLayout.<init>(TextInputLayout.java:96)
11-25 00:58:30.967: E/AndroidRuntime(27848): ... 24 more
11-25 13:32:29.967: E/AndroidRuntime(18136): Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.design.widget.TextInputLayout" on path: DexPathList[[zip file "/data/app/com.odibly.android-1/base.apk"],nativeLibraryDirectories=[/data/app/com.odibly.android-1/lib/arm, /vendor/lib, /system/lib]]
11-25 13:32:29.967: E/AndroidRuntime(18136): Suppressed: java.lang.ClassNotFoundException: android.support.design.widget.TextInputLayout
You need to add the following to your module build.gradle
file:
implementation 'com.google.android.material:material:1.0.0'
And use com.google.android.material.textfield.TextInputLayout in your XML:
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/text_input_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/my_hint">
You need to add this dependency in the gradle file
compile 'com.android.support:design:23.1.1'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With