Converting existing android support to androidX [c

2020-02-07 02:26发布

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?

3条回答
爱情/是我丢掉的垃圾
2楼-- · 2020-02-07 02:59

Try this

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

If you have any Maven dependencies that have not been migrated to the AndroidX namespace, the Android Studio build system also migrates those dependencies for you when you set the following two flags to true in your gradle.properties file:

android.useAndroidX=true
android.enableJetifier=true

For Reference

查看更多
戒情不戒烟
3楼-- · 2020-02-07 03:01

It is very simple. You have to click on the Refactor menu option and then click Migrate to AndroidX option.

This article gives step by step procedure to Migrate your project to AndroidX packages.

Disclaimer: I'm the author of the blog.

查看更多
\"骚年 ilove
4楼-- · 2020-02-07 03:17
  • 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

查看更多
登录 后发表回答