Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot fit requested classes in a single dex file (# methods: 90221 > 65536)

Each time I compile my android studio app to an APK I get this error message. My android studio version:

enter image description here

Error Messages:

enter image description here

enter image description here

How do you fix this error? It would be greatly appreciated if someone told me how to fix it.

like image 561
LolXDDev Avatar asked Sep 02 '25 15:09

LolXDDev


2 Answers

It appears that you must enable multiDexEnabled just beneath your minSdkVersion in the build.gradle(:app).

multiDexEnabled = true;

The background reason for this I have not yet fully investigated since in some instances, it will only fail during the building of the app-bundle and not on emulator.

like image 137
Ajowi Avatar answered Sep 05 '25 07:09

Ajowi


You need to make

minSdkVersion 21

At least 21.

like image 27
Uriel Frankel Avatar answered Sep 05 '25 05:09

Uriel Frankel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!