Reputation: 545
I'm working on an android app that already have many dependencies in it. I want to remove some starting by the bigger one's. How to check their size in the app?
Upvotes: 43
Views: 26278
Reputation: 3061
In new Android Studio you can navigate build/outputs/apk
(or build/intermediates/apk/debug
) folder double tap on apk file you are interested (there should be separate file for each flavor)
It will open a view like this:
there is
lib
folder where you can check a size of each library.
also you can se a size of resources and other stuf.
Upvotes: 47
Reputation: 13043
I couldn't find my library in the list of the output of the APK Analyzer, so I went with the most straightforward solution:
Upvotes: 0
Reputation: 1959
I don't know whether it helps you or not but I researched and found this.
select the project from the dropdown. go to your project. now select the libraries. right-click on the library you want to see the detail. choose the file path and click on the libraries or you can choose your dependency library. and go to the directory as shown in the figure below
Updated answer
With the latest android studio, you can see the size of apk with apk analyzer very powerful tool to analyze the apk.
- select Build from the menu and then select Analyze APK..
- give the path to the desired apk and press ok.
now you can review the size of all the files you want to.
Upvotes: 33
Reputation: 516
If anyone stumbles on this post, here is an even easier way to check.
All you have to do is compile your APK normally, take note of the size, then replace "implementation" for "compileOnly" in the library you want to check in your build.gradle.
This will generate an APK that crashes on runtime because it does not contain the library, but you can use it to compare and get the size said library adds to your APK.
Upvotes: 13