Reputation: 509
I want to add a new vector asset. I am trying to add a clipArt but it only shows in the dialog box "Nothing to show". No icon is showing and I want to add an icon. I don't know to fix this. Please help. I am still trying to learn android studio and I am practicing on how to use it.
Upvotes: 50
Views: 30927
Reputation: 387
To build on a couple of the most recent answers, it seems like Android Studio doesn't have the icons when it's installed. It will download the icons when the "Select Icon" screen is open after clicking on the "Clip art" icon, but it doesn't show that it's doing this in the UI and doesn't show any visible download progress.
For me, it seems like the bug was that if it doesn't finish downloading every icon it would start again the next time I opened the screen, first re-downloading the ones I already had and then moving on to the ones it didn't get to last time. I can't be 100% sure if this is actually what happened or if I had downloaded so few icons it merely seemed like it had repeatedly started from fresh, so I can't say if this is a caching bug plus a UI/UX bug or just a UI/UX bug.
After reading the other answers here, the fix was as simple as keeping the screen open for long enough to download all of the icons1. After the download completed I had to close the screen and open it again once, but then I was able to access every icon every time. I didn't need to make any files read-only and it carried on working even after restarting Android Studio. This took a full 20 minutes on a good internet connection, but it's possible I was bottlenecked by disk write speed or something else.
I'm not sure what will happen if there's an update to the Material Icons, or how often that will happen. If it invalidates the metadata file every other day because a new icon I'm never going to use got added, and if this actually is a caching bug and that one new icon would cause another 20 minutes of re-downloading every icon, then making the metadata file readonly after a full download is still an option to consider until that bug is fixed.
1 I was only able to tell that the download had finished by looking inside one of the folders in the icons cache until new stuff stopped getting added. The default icons cache locations are:
Windows %LocalAppData%\Android\Sdk\icons\material\
Mac OS Username/Library/Android/sdk/icons/material
Upvotes: 1
Reputation: 649
If you don't have the time or patience to fix Android Studio errors, you can easily download your icon from Google's icon library. Google's vector icons are available on the web at: https://fonts.google.com/icons
Upvotes: 2
Reputation: 2843
In Android Studio Hedgehog
, there is a bug in a way that you have to delete
the <sdk>/icons/material/icons_metadata.txt
file every time, cause it changes each time you open the vector assets dialog.
To avoid this, you can make the file read-only
through the file properties window.
Hope this helps.
Upvotes: 79
Reputation: 960
I had the same issue in Intellj IDEA. It seems to me that the initial download was incomplete.
The icons reappeared after I deleted <Android-SDK-Home>\icons\material\icons_metadata.txt
Upvotes: 11
Reputation: 397
If there are already this folders and still nothing in dialog try deleting <sdk>/icons/material/icons_metadata.txt
Credit to @MainActivity
Upvotes: 20
Reputation: 463
For myself, my asset dialog only shows some of these icons. And here is my solution.
Go to
[SdkPath]/icons/material
There should be a file called icons_metadata.txt
, and folders
For each icon, there will be one folder in the folders above. For example, we have materialicons/share
, materialiconsoutlined/share
and so on.
These icon folders are not complete, only icons starting with digits exist. Since the folder only updated when "Select Icon" dialog is opening, I opened "Select Icon" dialog again, waiting for all icons are downloaded, and then reopen the dialog.
Then my problem is solved.
Upvotes: 22
Reputation: 19
In Android Studio 4.1.1 this issue is resolved. Update if possible.
Upvotes: 1
Reputation: 304
Same thing happened with me, also i was not able to change my user name because of Win 10 Single Lang. so i just moved my SDK folder to another path but there was not space between the path like from >> C:\Users\User Name\AppData\Local\Android\Sdk to >> C:\Users\Sdk.
Upvotes: 2
Reputation: 327
It's working Your SDK folder name must be spaced less, ex- (UTTAM, UttamSdk, Uttam_sdk)
HAPPY CODING :)
Upvotes: 0
Reputation: 191
This a new problem introduced in the latest version of Android Studio 4.1. This happens when your windows user name folder contains a space. Rename your user name’s folder removing the space and it will work again.
For some reason the space make the folder where the icons are located not visible to Android Studio.
Upvotes: 6
Reputation: 1525
Those clip arts are located in "icons" folder inside your sdk folder on your hard drive and the sdk folder is generally this:
C:\Users\ --username-- \AppData\Local\Android\Sdk
I guess android studio cannot access the right sdk location so make sure the sdk location in your "File/Project Structure/SDK Location" matches the actual sdk location on your hard drive.
Alternatively, you can download the clip art you need from this link: Android Material and import them by choosing Local file in your Asset Studio.
Upvotes: 7