before android update 3.4 my application run perfectly but after upgrade android my application getting merging error:
\"Duplicate class android.support.v4.
You have androidx
libraries (probably in one of the used libraries) conflicting with the support
libraries.
Add these lines into your gradle.properties
file: (It's in the root directory of your project)
android.useAndroidX=true
android.enableJetifier=true
The Jetifier tool migrates support-library-dependent libraries to rely on the equivalent AndroidX packages instead.
Because after upgrade, androidx.core:core
is accessed somewhere, when your project is still not using androidx. So classes like INotificationSideChannel
and many others are now found at two places - androidx.core:core
and com.android.support:support-compat
. That's why this error occured.
You need to migrate to AndroidX which you should have done already. If you don't know about AndroidX. Please read What is AndroidX?
In Android Studio 3.2 (September 2018), there is direct option to migrate existing project to AndroidX
. This refract all packages automatically.
Before you migrate, it is strongly recommended to backup your project.
Existing project
New project
Put these flags in your gradle.properties
android.enableJetifier=true
android.useAndroidX=true
Check @Library mappings for equal AndroidX package.
Check @Official page of Migrate to AndroidX
First Select Refractor from top bar then from that select refract to androidx so it will create a zip file for you as a back up.
After that it will automatically be fine and fixes all kind of bugs and errors that are stopping the phone app from running
That's it!! You did it