在android studio中解析svg文件的内部错误 [英] Internal error parsing svg file in android studio

查看:19
本文介绍了在android studio中解析svg文件的内部错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从本月开始,我无法通过笔记本电脑中的 Vector Asset 导入任何 svg 文件,我总是收到消息解析 abc.svg 的内部错误"

Start from this month, I was not able to import any svg file though Vector Asset in my laptop, I always get the msg 'Internal error parsing abc.svg'

我尝试在其他笔记本电脑上使用 android studio 导入相同的 svg 文件,它可以工作,但我的笔记本电脑无法再导入.

I tried to import same svg file using android studio in other laptop, it works, but my laptop cannot import anymore.

我在笔记本电脑上使用 android studio 大约 2 年了,并且经历了很多更新,但是这个月突然不能再导入了,我在笔记本电脑中执行了出厂重置,并再次重新安装了 android studio.我也尝试创建新项目,但它仍然无法工作,有人可以帮助我吗?

I was using android studio in my laptop around 2 years and has been go through many updates, but this month suddenly cannot import anymore, I had performed factory reset in my laptop, and re-install android studio again. I tried create new project as well, but it still cannot work, anyone can help me?

推荐答案

2018 年 12 月 23 日更新

基于 issuetracker 似乎此错误已在 Android Studio 3.2 Canary 5 及更高版本中修复,因此请更新您的 android studio 是另一种修复方法!现在我使用 3.2.1 版并且工作正常.

Base on issuetracker seems this bug fixed in Android Studio 3.2 Canary 5 and above so update your android studio is another way to fix! now i use version 3.2.1 and work fine.

旧答案

我终于找到了解决方案.我不知道发生了什么,但是当我再次下载相同的 svg 并用记事本 ++ 打开它并以不同的名称将其导出为 svg 时,我遇到了同样的问题并得到了解决!这是工作!

Finally i found solution. I don't know what going on but i have same problem and fixed when i download same svg again and open it with notepad++ and export it with different name as svg! and it's work!

编辑

如果您使用 平面图标 下载 svg,请在下载前点击在编辑然后下载!这个 svg 在 android studio 中工作正常.

If you use flat icon for download svg, before download just click on edit and then download! this svg work fine in android studio.

我有 android studio 3.1.1

I have android studio 3.1.1

这只是android studio的一个bug

This just a bug in android studio

编辑 2

svg viewBox 中还有一个十进制数的错误,可以通过将十进制更改为整数来修复(感谢 crgarrido)

There is another bug in decimal numbers in svg viewBox that can be fixed by change decimal to integer (thanks to crgarrido)

示例:

将 svg 文件头中的十进制数更改为整数

Change decimal numbers to integers numbers in svg file header

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 375 135.4">

135.4改为135

这篇关于在android studio中解析svg文件的内部错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆