I can not define a vector image as an application icon [duplicate]

2

As you can see I have correctly added a image.svg so that it acts in a vector way:

TheproblemhappenswhenItrytoputitasanapplicationicon:

IgoinAndroidManifest.xmlandIusuallychangethelineandroid: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 would have to do something different after I saw that it did not work, but the application does not give me any other choices:

ItriedtoputtheimageinsidethemipmapfolderasIwastold,butitgaveanerror:

    
asked by anonymous 06.02.2017 / 22:10

1 answer

0

Try to save the file in the drawable folder then right-click and create a Vector Asset:

Anotherway!

Well...tofacilitatethissiteexists"Inside the link .txt" that converts any image into icon of Andoid Studio.

Attachment: Files

I'll explain how I did it:

  • I downloaded your file (.svg) as png.
  • I went to the site I went through and uploaded the image.
  • Set the null (transparent) background.
  • I saved ... in which you generated a ZIP (with a folder res)
  • Then replace in the project in the mipmap folders: (see attached image of the project)
  • Generating this result: (see the appendix to the emulator print)
  • Any questions you can ask !!!

        
    12.03.2017 / 04:24