[DEX] Sky’s the limit? No, 65K methods is

It happens in the blink of an eye. Before, you are an happy Android developer, head down on your (or your company’s) application, adding the coolest libraries to provide more functionalities and to write simpler code. Afterwards, you stare at the dreaded output that states:

Unable to execute dex: method ID not in [0, 0xffff]: 65536 Conversion to Dalvik format failed: Unable to execute dex: method ID not in [0, 0xffff]: 65536

And you are stuck, unable to create the DEX file for the APK. You have no idea of its meaning, nor the slightest clue about how to get around it. All you can do is going all in for the most logic option: panic.

It seems surprising that this isn't going to be fixed in ART (the new Android runtime). It's also surprising that Google isn't helping here by doing the unbundling of the Play Services dependencies to allow users to pick and chose the parts they want to use in their applications.