Leakcanary: Program type already present: android.support.v4.os.ResultReceiver

Created on 28 Jul 2018  路  17Comments  路  Source: square/leakcanary

Im getting Program type already present: android.support.v4.os.ResultReceiver in 1.6.1 but not in 1.5.4. Im using the androidx packages, in case that has anything to do with it.

needs more info

Most helpful comment

Adding
android.useAndroidX=true
android.enableJetifier=true
to gradle.properties fixed this for me. For some reason, it wasn't automatically added in an old alpha of android studio, or maybe i had reverted that file.

All 17 comments

I'm getting D8: Program type already present: android.support.v4.app.INotificationSideChannel$Stub$Proxy. I'm also using AndroidX.

I'm getting this problem too, also using AndroidX packages.

java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives
Program type already present: androidx.recyclerview.R$integer

Do you use this dependency: debugImplementation 'com.squareup.leakcanary:leakcanary-support-fragment:1.6.1' ? If yes, does that still happen when you remove it?

Happens in both cases.

I had the same problem and updating gradle plugin to 3.2.0-beta03 fixed the issue.

Can others confirm whether upgrading the gradle plugin works for them?

Im using 3.3.0-alpha04 when i reported this error. Not sure how i can downgrade it without downgrading android studio.

3.3.0-alpha05 has no issue with me as well.

I can also confirm that raising the gradle version to 3.3.0-alpha05 fixed the issue.

Can someone provide a sample project that reproduces this?

Adding
android.useAndroidX=true
android.enableJetifier=true
to gradle.properties fixed this for me. For some reason, it wasn't automatically added in an old alpha of android studio, or maybe i had reverted that file.

What if I am getting this and not using androidX?

What if I am getting this and not using androidX?

the same question.

Did you upgrade to 2.0 beta 2?

So I just had to go into all of my libraries and remove the implementation support for any that had it. I am using react native and so all of my additional libraries use facebook-react which implements support, making any other implementations of support redundant

In my case I had one library in _app > build.gradle_ which has "androidx" at the beginning. Search for "androidx" in _app > build.gradle_ and remove or change that dependency.

It worked for me. Hope it will help someone else fixing the issue.

Was this page helpful?
0 / 5 - 0 ratings