title: How to shrink code - 65k method limit in dex
body: <p>I have a rather large Android app that relies on many library projects. The Android compiler has a limitation of 65536 methods per .dex file and I am surpassing that number. </p>
  
  <p>There are basically two paths you can choose (at least that I know of) when you hit the method limit.</p>
  
  <p>1) Shrink your code</p>
  
  <p>2) Build multiple dex files (<a href="http://android-developers.blogspot.se/2011/07/custom-class-loading-in-dalvik.html" rel="noreferrer">see this blog post</a>)</p>
  
  <p>I looked into both and tried to find out what was causing my method count to go so high. The Google Drive API takes the biggest chunk with the Guava dependency at over 12,000. Total libs for Drive API v2 reach over 23,000!</p>
  
  <p>My question I guess is, what do you think I should do? Should I remove Google Drive integration as a feature of my app? Is there a way to shrink the API down (yes, I use proguard)? Should I go the multiple dex route (which looks rather painful, especially dealing with third party APIs)?</p>