The number of method references in a .dex file cannot exceed 64K

My V3 app code worked fine when testing on a device via “ionic cordova run android”. But all of a sudden, in doing a build, I’m getting the error

The number of method references in a .dex file cannot exceed 64K.

and I can’t do much at this point. Been googling for answers but not much luck.

Any idea how to fix this?

In case someone else experiences this, I fixed it by adding

       multiDexEnabled true

to the android {defaultConfig{} section of build.gradle

4 Likes

Hi,
thank you for your solution.
I’ve seen that you can solve the problem also changing the android-minSdkVersion,

I changed from 19;

<preference name="android-minSdkVersion" value="19" />

to 21 and solved the problem:
<preference name="android-minSdkVersion" value="21" />

cld

2 Likes

Since that the format of the file gradle.build has changed, I solved in this way:

Me salvaste la vida pase 1 día detenido por este error y eso lo soluciono, gracias