简体   繁体   English

我如何在 android studio 中修复我的矢量资产中没有显示的内容

[英]How I fix NOTHING TO SHOW in my vector asset in android studio

在此处输入图片说明

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.我仍在努力学习 android studio,我正在练习如何使用它。

This a new problem introduced in the latest version of Android Studio 4.1.这是最新版 Android Studio 4.1 中引入的新问题。 This happens when your windows user name folder contains a space.当您的 Windows 用户名文件夹包含空格时会发生这种情况。 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.出于某种原因,该空间使 Android Studio 无法看到图标所在的文件夹。

In Android Studio 4.1.1 this issue is resolved.在 Android Studio 4.1.1 中,此问题已解决。 Update if possible.如果可能,更新。

Those clip arts are located in "icons" folder inside your sdk folder on your hard drive and the sdk folder is generally this:这些剪贴画位于硬盘上 sdk 文件夹内的“icons”文件夹中,sdk 文件夹通常是这样的:

C:\\Users\\ --username-- \\AppData\\Local\\Android\\Sdk C:\\Users\\--用户名--\\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.我猜 android studio 无法访问正确的 sdk 位置,因此请确保“文件/项目结构/SDK 位置”中的 sdk 位置与硬盘驱动器上的实际 sdk 位置匹配。

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.或者,您可以从以下链接下载您需要的剪贴画: Android Material并通过在 Asset Studio 中选择本地文件来导入它们。

It's working Your SDK folder name must be spaced less, ex- ( UTTAM, UttamSdk, Uttam_sdk )它正在工作您的 SDK 文件夹名称必须间隔更少,例如( UTTAM、UttamSdk、Uttam_sdk

HAPPY CODING :)快乐编码:)

Same thing happened with me, also i was not able to change my user name because of Win 10 Single Lang.同样的事情发生在我身上,我也因为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.所以我只是将我的 SDK 文件夹移动到另一个路径,但路径之间没有空格,例如从 >> C:\\Users\\User Name\\AppData\\Local\\Android\\Sdk 到 >> C:\\Users\\Sdk。

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应该有一个名为icons_metadata.txt的文件和文件夹

  • materialicons材料图标
  • materialiconsoutlined材料图标概述
  • materialiconsround材料图标
  • materialiconssharp materialiconssharp
  • materialiconstwotone材料图标

For each icon, there will be one folder in the folders above.对于每个图标,上面的文件夹中都会有一个文件夹。 For example, we have materialicons/share , materialiconsoutlined/share and so on.例如,我们有materialicons/sharematerialiconsoutlined/share等。

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.然后我的问题就解决了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM