I've refactored my Android Studio codebase to AndroidX successfully. But it is causing a few problems with some of my libraries.
I need to revert it since the app is going into production soon. How can I do it?
So, if you want bug fixes or new features that would have previously gone into the Support Library, you need to migrate to AndroidX. Better package management. With AndroidX, you get standardized and independent versioning, as well as better standardized naming and more frequent releases.
AndroidX replaces the original support library APIs with packages in the androidx namespace. Only the package and Maven artifact names changed; class, method, and field names did not change. Caution: As of late 2021, most of the library ecosystem already supports AndroidX natively.
The android support library will be never maintained by Google under the support library namespace. So if you want to find fixes of a bug in support library you must have to migrate your project in AndroidX. Google play services, Firebase, Mockito 2, etc are already have migrated to AndroidX.
I had gone through the same, Follow the steps to undo the AndroidX Migration:
Remove following lines in gradle.properties
:
android.enableJetifier=true
android.useAndroidX=true
Remove AndroidX dependencies in build.gradle
of your app and replace them with their equivalent Non AndroidX dependencies:
e.g.
implementation 'androidx.core:core:1.0.0-beta01'
implementation 'androidx.appcompat:appcompat:1.0.0-beta01'
Sync Project with Gradle Files
After syncing you may have import errors in java files, you can remove the androidx imports and re add the equivalent non androidx imports
I hope it will help everyone facing migration rollback problem. If you get any conflict issues while performing above steps in Android Studio, try to clean and rebuild the project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With