Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vector Drawable as App Logo

Can we use a Vector drawable as the App logo in the Manifest file?

I am using one such drawable for my app logo, it works perfectly well.

But when I try to upload a release version of the app on the Playstore, it shows an error stating that Invalid Logo.

So is it due to the reason that I am using a vector drawable as an App logo. So can't use drawables for App logo ? If we can then how ('cause vector drawables go in drawables folder and not in mipmap) ?

like image 288
Parth Kapadia Avatar asked May 04 '26 14:05

Parth Kapadia


1 Answers

You can use vector drawables as launcher icon if you follow these steps:

  1. Place vector launcher icon under drawable directory. You can't place vector drawables in mipmap directory because they will work only in API levels 21 and above. As you possible know it's recommended to place PNG launcher icons under mipmap-<density> directories instead of drawable-<density> ones, but that only matters if you build separate apk for each density because in this case drawable-<density> directories except the one for the current density will be stripped.

  2. Remove vectorDrawables.useSupportLibrary = true in build.gradle defaultConfig section if you set it earlier. This will enable build-time PNG generation for vector drawables for API levels lower then 21. If you do not remove this option than android:icon attribute of the <application> tag will load default Android "green robot" icon.

I tested it on API level 16 device and it works perfectly.

like image 67
Suseendran Kandasamy Avatar answered May 06 '26 04:05

Suseendran Kandasamy



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!