Reputation: 1663
I am working on a Flutter application and have done all my development in VS Code (my preferred editor). I'm at a point where I need to add vector assets to my project.
I navigate to the folder in Android Studio my_app/android/app/src/main/res/
or my_app/android/app/src/main/res/drawable
and then right-click. I look for the option in the context menu: New > Vector Asset, but it's not there (see image below). This happens at both of the said paths.
my_app/android/app/res/drawable
and the option still doesn't not appear in the context menu.android
directory in Android Studio and that didn't work either.Where did the option go?
How do I add a vector asset with having to downgrade Android Studio versions?
Upvotes: 3
Views: 2946
Reputation: 880
Open resource manager from Tools:
From there press Import Drawables
Now you can select a svg file you want to import and name it etc.
Upvotes: 0
Reputation: 846
Given link is show you, how to add vector asset in android studio.
https://developer.android.com/studio/write/vector-asset-studio
You need to add setting in build.gradle (app) file.
android {
defaultConfig { vectorDrawables.useSupportLibrary = true
}
}
dependencies {
compile 'com.android.support:appcompat-v7:23.2.0'
}
steps to add vector asset in res folder: In Android Studio, open an Android app project. In the Project window, select the Android view. Right-click the res folder and select New > Vector Asset. Some other project views and folders have this menu item as well. If a Need Newer Android Plugin for Gradle dialog appears instead, correct your Gradle version as follows: Select File > Project Structure. In the Project Structure dialog, select Project. In the Android Plugin Version field, change the Android Plugin for Gradle version to 1.5.0 or higher, and click OK. Gradle syncs the project. In the Android view of the Project window, right-click the res folder and select New > Vector Asset. Vector Asset Studio appears.
Upvotes: 0
Reputation: 19554
They spruced it up, you use the Resource Manager
now - if the tab isn't on the top left of the screen then it's in the Tools
menu. Once that's open, press the +
icon in the top left and you can add a Vector Asset
. You can import one, or there's a Clip Art
option with built-in icons you can choose from.
edit- that might actually be what you're talking about, and I have the New > Vector Asset
option if I right click drawable
or res
, in both the Android
and Project
views. Maybe try a Clean
and Rebuild
in the Build
menu, or Invalidate caches/restart
in File
to give it a kick
Upvotes: 3