问题
After implementing jumbo dex, we dont get any further dex errors. The ~65K string limit is now exceeded, but not the method count. What is the limits we now face, if any, for strings and methods in an Android app?
回答1:
After some exhaustive testing. The details can be found below:
- The upper limit on method references and string references without jumbo dex is 65536.
- A method reference is a unique name by which a method is defined and/or invoked, and is only counted once. That is to say:
- if you call an externally defined method (e.g.. something in the core Java runtime) once, that’s one reference
- if you call it again, it’s still only one reference
- If you define a method, that’s one reference
- If you call the same method, it’s still only one reference
- A string reference is any unique string literal. Note this includes strings defined in resources that become literals in R.
- Jumbo dex doesn’t seem to have an effect via project.properties (or perhaps both Jon and I are doing it wrong), but it does appear to work in both local and server builds
- With jumbo dex on, the string reference limit is somewhere between 110K and 120K.
- With jumbo dex on, the method reference limit is still 65536 (confirmed!!)
来源:https://stackoverflow.com/questions/24634321/what-are-the-dex-method-and-string-limits-in-an-android-app