2
As you can see I’ve correctly added a svg. so that it acts in a vector way:
The problem happens when I try to put it as app icon:
I go to Androidmanifest.xml and normally modify the line android:icon="@drawable/ic_tree"
just like I do with a drawable normal:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="genesysgeneration.svg">
<application
android:allowBackup="true"
android:icon="@drawable/ic_tree"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
I thought I’d have to do something different after I saw it didn’t work out, but the app doesn’t give me any other choices:
I tried to put the image inside the mipmap folder as indicated, but it was wrong:
Creates the mipmap folder and place the icon there. It is the new Android standard.
– GabrielLocalhost
You made an error... I edited the question by presenting it.
– Boneco Sinforoso
Well I’ll try later, never tried to use vector in mipmap. But it is sure that android adopts this new standard.
– GabrielLocalhost
What is the
minSdkVersion
and thetargetSdkVersion
for the app? What version of android is running on emulator?– ramaral
15 and 25 respectively... (4.0.3 ice cream Sand...) and (7.1 nougat)
– Boneco Sinforoso
I tested on 9, 16 and 25 and it works. Update/Use the latest versions of Android Studio, Build Tools, build:Radle tools and Support Library.
– ramaral
I updated the android studio, the error to put in mipmap is gone, but still does not show the correct icon
– Boneco Sinforoso
I would like to use API 15 anyway, because I am more used to it and it is from it that there are most users.
– Boneco Sinforoso
In my answer to your question Error trying to display a vector image (SVG)! do not use what is described in Note 1, see Note 2.
– ramaral
Please post the icon file, so you can test it here. To help you...
– Tiago Domingues
https://uploaddeimagens.com.br/imagens/tree-svg
– Boneco Sinforoso