Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

reducing apk size with vector drawable

I'm trying to reduce the apk size of my android app.

I've read this guide: https://developer.android.com/topic/performance/reduce-apk-size

I already converted all my images to vector drawable, so they are sightly smaller.

But when i click on generate apk, android studio does create an PNG version of each of my vector drawable and package it together with the vector in the final apk

So it was pointless since now my apk has both vector and png...

how can i force android studio to use the vector drawable making the user scale the images at runtime?

like image 294
Rafael Lima Avatar asked Feb 24 '26 18:02

Rafael Lima


1 Answers

As the official doc says:

If the minimum API level is Android 4.4 (API level 20) and lower, and you haven't enabled the Support Library technique, Vector Asset Studio generates PNG files.

so check if your project meets this condition.

like image 95
navylover Avatar answered Feb 27 '26 07:02

navylover



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!