Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

com.android.support:design with androidX (1.0.2)

I want to use TextInputLayout inside my project, but I'm using androidX library

implementation "androidx.appcompat:appcompat:1.0.2"

/*this don't work*/
implementation "com.android.support:design:28.0.0"

This is the exception which I'm facing

android.view.InflateException: Binary XML file line #30: Binary XML file line #30: Error inflating class android.support.design.widget.TextInputLayout Caused by: android.view.InflateException: Binary XML file line #30: Error inflating class android.support.design.widget.TextInputLayout Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.design.widget.TextInputLayout" on path: DexPathList[[zip file "/data/app/com.example

like image 821
Mohammad Al-Hussein Avatar asked Jan 26 '26 15:01

Mohammad Al-Hussein


1 Answers

Error inflating class android.support.design.widget.TextInputLayout Caused by: java.lang.ClassNotFoundException: Didn't find class

This error thrown when the Java Virtual Machine (JVM) tries to load a particular class and the specified class cannot be found in the classpath.

You should use

com.google.android.material.textfield.TextInputLayout

DEMO

  <com.google.android.material.textfield.TextInputLayout
   android:layout_width="match_parent"
   android:layout_height="wrap_content"
   >

   <com.google.android.material.textfield.TextInputEditText
       android:layout_width="match_parent"
       android:layout_height="wrap_content"
       />
</com.google.android.material.textfield.TextInputLayout>

Then Clean-Rebuild-Run.

like image 88
IntelliJ Amiya Avatar answered Jan 28 '26 04:01

IntelliJ Amiya



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!