Sitemap
Android Developers

Articles on modern tools and resources to help you build experiences that people love, faster and easier, across every Android device.

Illustration of a laptop with the Android on the screen and other tech objects in the background.

Migrating to AndroidX: tips, tricks, and guidance

7 min readMar 25, 2020

--

Why migrate?

Preparing to migrate

Migrate

Step 1: Update to Support Library version 28

Step 2: Enable Jetifier

android.useAndroidX=trueandroid.enableJetifier=true

Step 3. Update dependencies

Error : Program type already present: android.support.v4.app.INotificationSideChannel$Stub$Proxy |Reason: Program type already present: android.support.v4.app.INotificationSideChannel$Stub$Proxy
Duplicate class android.support.v4.app.INotificationSideChannel found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:28.0.0)

Step 4: Update your source code

Those pesky exceptions

Version configuration files

ext.versions = [    ‘drawer’ : ‘28.0.0’,    ‘rview’ : ‘28.0.0’]implementation “com.android.support:drawerlayout:${versions.drawer}”implementation “com.android.support:recyclerview-v7:${versions.rview}”
ext.versions = [    ‘drawer’ : ‘28.0.0’,    ‘rview’ : ‘28.0.0’]implementation “androidx.drawerlayout:drawerlayout:1.0.0”implementation “androidx.recyclerview:recyclerview:1.0.0”
ext.versions = [    ‘drawer’ : ‘1.0.0’,    ‘rview’ : ‘1.0.0’
]
implementation “androidx.drawerlayout:drawerlayout:${versions.drawer}”implementation “androidx.recyclerview:recyclerview:${versions.rview}”

ProGuard and build scripts

Get the latest stable version

implementation ‘com.android.support:appcompat-v7:28.0.0’
implementation ‘androidx.appcompat:appcompat:1.1.0-alpha01’
implementation ‘androidx.appcompat:appcompat:1.0.2’

More help and resources

Final thoughts

--

--

Android Developers
Android Developers

Published in Android Developers

Articles on modern tools and resources to help you build experiences that people love, faster and easier, across every Android device.

Nick Anthony
Nick Anthony

Written by Nick Anthony

Program Manager, Android Jetpack

Responses (2)