Android package build fails with DexIndexOverflowException error

In some cases a build will fail with this error because the dex files being merged include more than 65536 methods or strings. This can be corrected by enabling jumbo mode using a build-extras.gradle file.

build-extras.gradle

Create a file named build-extras.gradle in the root of your project with the following contents:

android { dexOptions { jumboMode true }}

config.xml

Add a resource-file node to the Android platform in config.xml with the target path shown below. This will move the build-extras.gradle file to the correct location when your platform is generated.