Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Converting existing android support to androidX [closed]

I am working on an existing project. I want to convert my android project(oreo) from the support library to androidX library. I have tried many tricks and tips but no progress at all.

What is the easiest approach to do that?

like image 231
Zeeshan Ahmad Avatar asked Mar 30 '19 06:03

Zeeshan Ahmad


People also ask

Can I use library that used Android support with AndroidX projects?

Note: With the release of Android 9.0 (API level 28) there is a new version of the support library called AndroidX which is part of Jetpack. The AndroidX library contains the existing support library and also includes the latest Jetpack components. You can continue to use the support library.

How do I switch to AndroidX?

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.

Is it mandatory to migrate to AndroidX?

Migration is mandatory: All new Jetpack libraries will be released in AndroidX namespace. So, for example, to take advantage of Jetpack Compose or CameraX, you need to migrate to the AndroidX namespace.


1 Answers

  • Update your android studio

    https://developer.android.com/studio

  • Set compileSdkVersion to 28

    enter image description here

  • Set com.android.tools.build:gradle:3.2.0 in build.grade(project:X) in dependencies to min 3.2

    enter image description here

  • Go to Refactor-> Migrate to androidX

    enter image description here

like image 64
Ahmed Mujtaba Avatar answered Sep 23 '22 04:09

Ahmed Mujtaba