Reputation: 60241
This might seems old, but I can't find this to exact where...
In https://developer.android.com/studio/build/multidex.html, it is mentioned:
Android app (APK) files contain executable bytecode files in the form of Dalvik Executable (DEX) files, which contain the compiled code used to run your app. The Dalvik Executable specification limits the total number of methods that can be referenced within a single DEX file to 65,536—including Android framework methods, library methods, and methods in your own code. In the context of computer science, the term Kilo, K, denotes 1024 (or 2^10). Because 65,536 is equal to 64 X 1024, this limit is referred to as the '64K reference limit'.
My question is, is this 64K limit of method count just counting the public methods, or does it include all methods (i.e. private or protected etc.)?
Upvotes: 2
Views: 244
Reputation: 6373
From the docs you've pasted - it doesn't qualify 'the total number of methods' with a specific visibility like 'public', because it includes all of them.
So the answer is all methods contribute towards the dex count, regardless of their visibility.
Upvotes: 5