11

I am trying to migrate my project to androidX. The project i am trying to migrate is based on android support libraries AppCompat. In the Developer Documentation it says that you can migrate to AndroidX by doing the Following: Android Studio -> Refactor -> Migrate to AndroidX But when i am following these steps, i end up at Refactor, because i only have got the option Migrate to AppCompat. I am not sure what to do.

Additional Info:
Android Studio Version: 3.1.4(Stable Channel)
Android SDK Tools Version: 26.1.1

Thanks for any help!

laim2003
  • 299
  • 4
  • 19

3 Answers3

8

"Refactor to AndroidX" option is available for AndroidStudio 3.2 stable and later. https://developer.android.com/studio/

laim2003
  • 299
  • 4
  • 19
Tuby
  • 3,158
  • 2
  • 17
  • 36
  • After checking for IDE updates in Android Studios Settings, it says " You have already the latest version of Android Studio and Plugins installed". Do I need to download the 3.2.x update from an external source? – laim2003 Aug 11 '18 at 10:06
  • 1
    Yes, there are 3 or 4 channels of Android Studio, you are using "Stable" now, you have to download full Android Studio "Beta" or "Canary" to start using unstable releases – Tuby Aug 11 '18 at 10:07
  • 4
    I have Android Studio 3.2, but "Refactor to AndroidX" option is still missing. Any ideas? – getsadzeg Sep 13 '18 at 12:10
  • @laim2003 are you claiming they removed the feature altogether in all versions before 3.5? Seems weird – Tim Sep 02 '19 at 11:57
  • @TimCastelijns No, I meant that "migrate to AndroidX" is implemented in every version of AndroidStudio 3.2 stable and later. – laim2003 Sep 02 '19 at 12:42
  • @getsadzeg I updated the answer, this solution should work for you. – laim2003 Sep 02 '19 at 12:43
3

Switch to "Android" or "Project" tab in the file navigation window. And right click on your parent folder and go to refactor, there listed "Migrate to android" option. It is very simple. In case of any mistakes in migration we can switch back to appcompat version using "migrate to appcompat" under same menu.

Anbarasu Chinna
  • 975
  • 9
  • 28
  • 1
    This should be the accepted answer, because even if you have Android Studio 4.0 the menu only show migrate to JUnit5. – moxi Jun 26 '20 at 15:45
0

If you have the same problem after you updated AndroidStudio to 3.2 or later, you can modify your ***.kts to ***.gradle. I solved my problem this way.

Andrey
  • 702
  • 1
  • 9
  • 22