Package Native Android, was working, now fails

I started getting failures with Ionic Pro Native Packaging on Android. The failure is:

:transformDexWithDexForRelease FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ‘:transformDexWithDexForRelease’.
> java.util.concurrent.ExecutionException: Multiple dex files define Lcom/google/android/gms/auth/api/signin/internal/zzo;

To attempt tracking where the error originated, I submitted native packaging jobs to other builds in my build history to see which commit introduced the problem. This got me to the point where I ended up submitting a native packaging job to the last job where native packaging succeeded. This time it failed.

Comparing logs between the failed and successful packaging I noticed that the build is now using There are other version updates. My theory is that there is some dependency in my project that is not pegged to a specific version and so the Packaging jobs running on ionic pro are not packaging with identical versions.

My project seems to package fine on my local host with ionic cordova build android --prod --release. I even went through the steps on to attempt locally identifying how to fix, but what succeeds locally, fails on ionic pro.

Any advice would be welcome. Thank you

i can fix doing that. On the platform/android/ i have the following dependencies :


i repleaced with :


i put the same version of ‘’ differents artifcats and build success

Hope that help

Thanks for the advice @snakepit

When I build android locally with

ionic cordova build android --prod --release

I don’t have this issue. The problem is only on the ionic pro build channel, when I select package native binary. These builds come from my .git channel, I don’t commit my platforms files there and I am a little hesitant to update my config.json to try and do a edit-config patch of the android

Its not that big a deal I suppose of the ionic pro native packaging for android fails since I can do so on my own workstation.

I’m not sure why, but now I am seeing the problem on my local builds.

Tracking things down I think it might be an incompatibility between cordova-plugin-firebase and cordova-plugin-googleplus.

I created a new ionic project added these plugins and ionic build android fails with the same error.

<plugin name=“cordova-plugin-firebase” spec="^0.1.25" />
<plugin name=“cordova-plugin-googleplus” spec="^5.2.2" />

Try this

ionic cordova platform rm android
ionic cordova platform add android

Thanks I tried, it over and over again. tried deleting node_modules, plugins, package-lock.json.
I tried

rm -rf node_modules plugins, package-lock.json
npm install
ionic cordova platform rm android
ionic cordova platform add android@6,4.0
ionic cordova build

got the same error.

I would get the same error doing

ionic start testbuild blank
cd testbuild
ionic platform add android@6.4.0
ionic cordova plugin add cordova-plugin-firebase
ionic cordova plugin add cordova-plugin-googleplus
ionic cordova build android

my ionic info:

cli packages: (C:\Users\Daddy B\AppData\Roaming\npm\node_modules)
@ionic/cli-utils : 1.19.2
ionic (Ionic CLI) : 3.20.0
Node : v8.9.4
npm : 5.6.0
OS : Windows 10
backend : pro

What I finally found that helps is adding this plugin:

TL;DR: To prevent build failures caused by including different versions of the Play Services library.

Some Cordova plugins include the Play Services library to faciliate them. Most commonly, these are now included into the Cordova project by specifying them as Gradle dependencies (see the Cordova plugin spec documenation).

Example plugins:


The problem arises when these plugins specify different versions of the Play Services library. This can cause build failures to occur, which are not easy to resolve without changes by the plugin authors to align the specified versions. See these issues:


To resolve these version collisions, this plugin injects a Gradle configuration file into the native Android platform project, which overrides any versions specified by other plugins, and forces them to the version specified in its Gradle file.

If you’re encountering similar problems with the Android Support libraries, checkout the sister plugin: cordova-android-support-gradle-release.