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

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

问题描述

从本月开始,我无法通过笔记本电脑中的Vector Asset导入任何svg文件,我总是收到msg解析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并使用notepad ++打开它并以不同的名称将其导出为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中的一个错误

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天全站免登陆