Check how many methods you have in Android Studio

TomCB picture TomCB · Jan 4, 2015 · Viewed 12k times · Source

It looks like I'm flirting with the dex limit of 65K, if I write some new methods I have a dex error, if I remove some older things, it's gone.

Is there a way to check how many methods you are using at the moment in Android Studio?

Answer

Chris Knight picture Chris Knight · Nov 5, 2018

Android Studio provides a built in way to do this. Change to the 'Project' view, navigate to /app/build/outputs/apk/path to flavor/type apk. Double click on the APK. This will launch the apk in the editor where you can see the various libraries and their associated sizes in the top half of the window. Scroll down in this window until you find classes.dex (or if you have more than one, classes2.dex, etc.). Click on this and in the bottom of the window you will see method references by package. You can also use this view to analyse the constructed Android Manifest if you work with multiple flavors or build types. More info can be found on the android developer site

enter image description here