Duplicate classes from androidx and com.android.support

Add these lines to your gradle.properties

android.useAndroidX=true
android.enableJetifier=true

If gradle.properties is absent, create the file in the root directory of your project.

It looks like you have some support relics anywhere in your dependencies, maybe from a lib? To investigate and see the dependencies tree, please run:

./gradlew :yourApp:dependencies

and then you see from where it comes.


In your app build.gradle you are using a mix of old support library and new support library artifacts. Remove one of them from your build.gradle to resolve this issue.

Old artifact: com.android.support:support-compat

Corresponding new artifact: androidx.core:core:1.0.0

See this page for more information on migrating to AndroidX.