I'm encountering issues with my application having too many methods.
In the last post in the below link, a poster posts the method count for his application (broken down by package). I unable to find how I can get this information for my application, any suggestions?
https://code.google.com/p/android/issues/detail?id=20814
Please press CTRL+O in your respective Java Class in the Eclipse IDE - You will get the number of methods in the respective Java class.
There are two types of methods in Java: Predefined Method. User-defined Method.
Open your file in editor and click on structure tab, it will show all the methods in the class selected. Click on any method and you will be redirected to that method. Show activity on this post. You can use CTRL + F12 shortcut in windows for that purpose.
I use
cat build/dex/debug/classes.dex | head -c 92 | tail -c 4 | hexdump -e '1/4 "%d\n"'
I get 55176
. 64k limit is coming :D
To get a method-count report on every build, do this:
in app/build.gradle
:
buildscript {
repositories {
mavenCentral() // or jcenter()
}
dependencies {
classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.7.3'
}
}
// make sure this line comes *after* you apply the Android plugin
apply plugin: 'com.getkeepsafe.dexcount'
It will show the number of methods per package, for your own project and the libraries you use.
From: https://github.com/KeepSafe/dexcount-gradle-plugin
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With