Unable to merge dex

I had finally gotten my application deployed to my device, and then I added the cordova-plugin-email-composer which added the following to my config.xml:

<plugin name=“cordova-plugin-email-composer” spec="^0.8.12" />

When I try to build using ‘cordova build android’, I now get:

Execution failed for task ‘:app:transformDexArchiveWithExternalLibsDexMergerForDebug’.

java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex

I’ve see posts about enabling multidex but that doesn’t work, nor does it make much sense as to why I would need it for my fairly small app. Any ideas?

So I turned on the gradle stacktrace option and now see:

Caused by: com.android.dex.DexException: Multiple dex files define Landroid/support/v4/widget/ContentLoadingProgressBar$1;

It appears that the cordova-plugin-email-composer has a dependency on this which I assume is the cause of the duplication. Is there a way to resolve this?

I was able to get around this by creating a build-extras.gradle in platforms/android/app that forces a particular version:

configurations.all {
  resolutionStrategy {
    force ‘com.android.support:support-v4:24.1.1+’
  }
}