I had the same problem as the OP and I followed all the steps but now I am getting a different error. I’ve been searching all over and see similar issues but none of the solutions are fixing this for me and I am really confused as to what the actual problem is.
Cordova CLI: 7.0.1
Ionic CLI Version: 2.2.3
Ionic App Lib Version: 2.2.1
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Linux 4.9
Node Version: v6.11.1
Xcode version: Not installed
I am running ‘ionic package build android’ and getting a long error that boils down to this.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl;
Thanks I removed cordova-plugin-android-support-v4-jar 23.2.1 “Android Support v4” and now I am getting a different error
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':processDebugManifest'.
> Manifest merger failed : Attribute meta-data#android.support.VERSION@value value=(25.3.1) from [com.android.support:appcompat-v7:25.3.1] AndroidManifest.xml:27:9-31
is also present at [com.android.support:support-v4:26.0.0-alpha1] AndroidManifest.xml:27:9-38 value=(26.0.0-alpha1).
Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:25:5-27:34 to override.
It looks like this is a problem with two plugins having a conflict(at least from what I can tell so far) but I haven’t installed any new plugins and builds have always worked for me.
All I did was update cordova and android when I had a gradle problem. Really lost here
It happened with me recently, and i tried couple of ways and my last way was to remove the v4 plugin which worked.
I think your app cordova-plugin-compat 1.1.0 “Compat” plugin is doing some issues. Kindly, remove it and add everything again
Ok I removed all the plugins and the build was successful and then I added them back one by one until it finally failed when I added “cordova-plugin-document-viewer” which included “cordova-plugin-android-support-v4-jar” So it was something with the V4. I am trying to figure out how to work around this and might just use a different plugin.
Put this at the end of your app module build.gradle:
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == ‘com.android.support’) {
if (!requested.name.startsWith(“multidex”)) {
details.useVersion ‘25.3.0’
}
}
}}