How to generate png from a vector launch icon using minSdkVersion 21?

I have an application with minSdkVersion = 21, which now uses a vector that can be used as a launch icon.

Google Play rejects the app using

You need to check the icon inside your APK because it is not valid

since it should run the icons in PNG format.

I would like to generate PNG files for the launcher icon as part of the build process, as it is, if I reduce minSdkVersion to 20 (but I cannot do this because the application is incompatible with 20 or older). Is it possible?

EDIT: To clarify, it works when minSdkVersion is <21, since gradle takes care of generating png versions of vector drawings. But when minSdkVersion> = 21, gradle leaves the vector drawings as is, which does not work for startup icons. The question is whether it is possible to make gradle build png versions of vector drawings for startup images even at minSdkVersion> = 21.

+4
source share
2 answers

It seems Google Play now supports vector drawings (December 2017) as launch icons. I recently downloaded and published an app with the laucher icon.

+3
source

, ( SVG) PNG .

, SVG , , , SVG PNG ( cmd ImageMagick ).

- , - Android Asset Studio

, , Android PNG , , android Gradle, XML SVG, PNG. java Groovy , .


https://developer.android.com/studio/write/image-asset-studio.html#access Android Studio , , -, , .

+2

Source: https://habr.com/ru/post/1662749/


All Articles