Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Enable Android X for specific application module

I'm new to Android X library which seems a next version of original Android Support Library. And I decided to migrate my existing project to Android X.

I've got multiple application modules in a single project. There are about 20 application and library modules. As per the guide, I'm trying to enable Android X.

My question is if there is any way to enable Android X for the specific module, not for entire project.

like image 446
Doctiger Avatar asked Nov 23 '18 14:11

Doctiger


People also ask

How do I enable Android X?

Migrate an existing project using Android Studio 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.

What is Android X?

AndroidX is the open-source project that the Android team uses to develop, test, package, version and release libraries within Jetpack. AndroidX is a major improvement to the original Android Support Library.

What is an android app module?

Android Studio offers a few distinct types of module: Android app module. Provides a container for your app's source code, resource files, and app level settings such as the module-level build file and Android Manifest file. When you create a new project, the default module name is "app".

What is Android X migration?

With AndroidX, you get standardized and independent versioning, as well as better standardized naming and more frequent releases. Other libraries have migrated to use the AndroidX namespace libraries, including Google Play services, Firebase, Butterknife, Databinding Mockito, and SQL Delight among others.


1 Answers

Simple way is to Right Click -> Refactor -> Migrate to Android X

According to the docs, you CAN NOT have both AndroidX and Android Support libraries in your project.

It's either all are AndroidX libraries or all are Android Support libraries.

AndroidX is just the newer version.

But an important point to note is that thought 'Migrate to Android X' refactors libraries as well as the view tags you used, it still can leave some gaping holes.

When I migrated, my RecycerView in Activity.java was useless. Should something similar happen, don't worry

In java, just try working with importing the relevant androidx packages, that's what solved for me. Though this isn't a frequent issue

like image 126
C Forge Avatar answered Oct 20 '22 00:10

C Forge