Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use legacy support library option in android

Should I select the Use legacy android.support libraries option when creating a new project? What will happen if I don't select this option?

image

like image 320
jai singh Rawat Avatar asked Jun 11 '20 13:06

jai singh Rawat


2 Answers

A little context:

Up until recently, almost every Android app used the android.support libraries so that they could use features introduced on new Android versions also on older Android versions. You can read about it here: https://developer.android.com/topic/libraries/support-library

Recently, Google announced that there would be no new releases for the support library, and that instead the support library would become a new library called AndroidX. Here's their announcement:

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. Historical artifacts (those versioned 27 and earlier, and packaged as android.support.*) will remain available on Google Maven. However, all new library development will occur in the AndroidX library.

We recommend using the AndroidX libraries in all new projects. You should also consider migrating existing projects to AndroidX as well.

So all Android apps should now aim to use AndroidX, instead of the old support library. When you create a new project in Android Studio, it will by default use AndroidX, but you can still choose to Use legacy android.support libraries if you wish, by clicking the checkbox you found.

Most of the time, you probably want to use AndroidX

like image 143
Luke Avatar answered Sep 30 '22 20:09

Luke


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. Support Library

If you check this option, the android studio will use android.support library otherwise it will use androidx library.

the android.support library is deprecated, so you don't need to check this option.

like image 25
Ehsan msz Avatar answered Sep 30 '22 19:09

Ehsan msz