skip to Main Content

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

2

Answers


  1. 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

    Login or Signup to reply.
  2. 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

    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.
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search