Error While Merging Dex Program Type Already Present: Android.Support.V4.Os.Resultreceiver$Myresult
receiver

Program type already present: android.support.v4.os.ResultReceiver$MyResult
Receiver

I have very similar problem and in my case solution is add in gradle.properties this two lines:

android.useAndroidX=true
android.enableJetifier=true

I hope it will help.

Program type already present: android.support.v4.os.ResultReceiver$MyResult
Receiver on Ionic

I had the same issue, and found out it was because of the firebase and googleplus plugins. Finally found a solution that worked for me :

ionic cordova plugin add cordova-plugin-androidx
ionic cordova plugin add cordova-plugin-androidx-adapter

Simply adding these plugins removed any build error.

Getting error while running Error: Program type already present: android.support.v4.os.ResultReceiver$MyResult
Receiver

just marge dependency on AndroidX Library.

Example: app/build.gradle:

implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'

to:

implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'

Than rebuild again, shows many errors. just comment out these old libraries. re-import android x library package.
Example below:
Sample Image

Sample Image

Sample Image

Sample Image

Marge AndroidX: https://developer.android.com/jetpack/androidx/migrate

I hope solved.

Error: Program type already present: android.support.v4.os.ResultReceiver$MyResult
Receiver

Most probably some libs are using androidx.

To find which one, run

./gradlew tasks --all

find a line like this

yourapp:dependencies

use it to get the dependency tree

./gradlew yourapp:dependencies 

Pert of my dependency tree

Sample Image

In my case it was the Advanced RecyclerView, in their page there is this notice "v1.0.0 Migrated to AndroidX (Use v0.11.0 instead if your project uses support libraries)" So i followed the advice and my problem was solved.



Related Topics



Leave a reply



Submit