How to enable multidex support?

Monkey Targets Forums/Android/How to enable multidex support?

DeadFall(Posted March) [#1]
I ran into this error today while working,

[dx] UNEXPECTED TOP-LEVEL EXCEPTION:
[dx] com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536

when investigating the error, I found the problem ends up being too man methods or something. Where the number of methods is limited to 65536 and going over that number gives the above error. To get around it people have said you need to enable multidex support by adding some code to build.gradle and some details to the android manifest.

I personally have no idea how to resolve this and edit the correct file to enable multidex or if it's even possible with monkey.

If that's not possible I just need to go over some files I'm using and try to remove the ones I don't need. Currently it's appodeal that seems to be putting me over the limit.

Thanks for any advice in advance.