Home > OS >  <androidx.appcompat.widget.AppCompatEditText>
<androidx.appcompat.widget.AppCompatEditText>

Time:09-06

hello i want to use androidx library but it's not showing for me and i tried Refactor->Migrate to androidx and it didn't work too can i get help please..

https://i.stack.imgur.com/xHNJ9.png

CodePudding user response:

Make sure all those dependencies are added to your project. Then still face your problem go to the android studio file->invalid caches and restart.

https://i.stack.imgur.com/cXzGu.png

CodePudding user response:

hello i want to use androidx library but it's not showing for me and i tried Refactor->Migrate to androidx and it didn't work too can i get help please..

Looking at below picture: https://i.stack.imgur.com/cXzGu.png

You can't use androidx for TextInputEditText because that widget is a property of Google material design. That means, the intellisense autocomplete dialog is showing you the exact and correct code. Check here and see the artifact mapping list of android support library to androidx or android jetpack

But before then, according to this post it reads:

With Android Studio 3.2 and higher, you can migrate an existing project to AndroidX by selecting Refactor > Migrate to AndroidX from the menu bar.

The refactor command makes use of two flags. By default, both of them are set to true in your gradle.properties file:

android.useAndroidX=true

The above ☝️ will allow Android plugin to make use of the appropriate AndroidX library instead of Android Support Library.

android.enableJetifier=true

The above ☝️ Android plugin automatically migrates existing third-party libraries to use AndroidX by rewriting their binaries.

In conclusion, if above lines of codes are not in your gradle.properties file then you can add them and sync gradle

  • Note: The built-in Android Studio migration might not handle everything. Depending on your build configuration you may need to update your build scripts and Proguard mappings manually. For example, if you maintain your dependency configuration in a separate build file, use the mapping files mentioned below to review and update your dependencies to the corresponding AndroidX packages.

Please upvote if it helps...

  • Related