After I added one more library, I discovered that I am now hitting the 64K 
method limit. 

No problem, because it appears building for MultiDex is now well 
documented. And maybe it is time. 

However I am scared off by the *catastrophic* limitations:
https://developer.android.com/tools/building/multidex.html#limitations

*-Applications that use multidex may not start on devices that run versions 
of the platform earlier than Android 4.0 (API level 14)*
"May not"? So is this only for those who want to deprecate everything prior 
to Android 4.0? 
I'm not sure end users will be all that understanding if the app doesn't 
start. 

*-Applications using a multidex configuration that make very large memory 
allocation requests may crash during run time due to a Dalvik linearAlloc 
limit*
 My app makes large memory requests, don't know if its "very large", so I 
expect it will crash. 


*-Can result in Application Not Responding (ANR) errors if the secondary 
dex files are large.*How large? Obviously, if they have 65k methods like 
the original, it will be too large, right? So by what percent, exactly, is 
one raising the method limit through this method? So now the practical 
limit is 72K, or what?

*-Make sure to perform testing with these versions of the platform as your 
application can have issues at startup or when particular groups of classes 
are loaded.*
Since my testing is world class (not) and I've always been able to find 
model specific issues well ahead of end users before (not), this should 
give me lots of confidence. 
If I do find them, what do I do?

-Code shrinking can reduce or possibly eliminate these potential issues.
So this is a maybe then?

In summary, then my app may not start on Android<4, will likely crash on 
Android<5, and I just shrink code and hope for the best. 

So are Google maps and Gmail confident in using MultiDex, for example? 

At this point, I don't find using Multidex to be an acceptable risk. 
Maybe its only postponing the problem, but an alternate strategy is this: 
Tell the third party that wants to run the promotion and just handed me an 
AAR file with 11,499 methods to reduce their method count or the deal is 
off. 

Nathan




-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to