August 2014
PermaLink Android's Horrid 64K DEX Method Limit08/17/2014
One of the worst design decisions in the Android Dalvik virtual machine is the 64K method limit (this limit includes all methods in your application and all libraries you link in; note that this is not the same as Facebook's 64K Dalvik Runtime issue.  The cryptic compile time error you'll get during a build of your project is:
  java.lang.IllegalArgumentException: method ID not in [0, 0xffff]: 65536

This problem will manifest easily if you hook in a few libraries that have a lot of methods, including notably the Google Play Services Library  which can suck up 1/3 of this limit.  Other libraries that are huge include the Amazon Web Services library and Guava and Protobufs (which you can substitute with Square's Wire to reduce the method count).  You can analyze the method count using dex-method-counts.

Note: Google's official workaround is multidex support.



(3)

Start Pages
RSS News Feed RSS Comments Feed CoComment Integrated
The BlogRoll
Calendar
July 2018
Su
Mo
Tu
We
Th
Fr
Sa
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Search
Contact Me
About Ken
Full-stack developer (consultant) working with .Net, Java, Android, Javascript (jQuery, Meteor.js, AngularJS), Lotus Domino