XmlPullParserException二进制XML文件行#17< vector>标签需要viewportWidth> 0 [英] XmlPullParserException Binary XML file line #17<vector> tag requires viewportWidth > 0
问题描述
这是该问题的后续问题:
This is a follow up question to this question:
将Android支持库更新为23.2.0原因错误:XmlPullParserException Binary XML file line#17< vector>标签需要viewportWidth> 0
我还将支持库更新为23.2,并开始收到错误消息:
I also updated the support library to 23.2 and started getting the error:
XmlPullParserException Binary XML file line #17<vector> tag requires viewportWidth > 0
这个问题为Android Studio和Gradle解决了.在没有Gradle的情况下使用Eclipse如何解决?
That question solved it for Android Studio and Gradle. How can this be solved when using Eclipse without Gradle?
推荐答案
该问题的上一个答案为使用Gradle的开发人员提供了解决方案,但是我不使用Gradle,因此我想总结一下他的答案,这对几个人都有帮助以及我最终做了什么.我接受了我自己的回答,而不是他的回答,因为就像我说的那样,我不使用Gradle,所以我不使用他写的东西.
A previous answer to this question had a solution for developers who use Gradle, but I don't use Gradle so I want to summarize his answer which helped several people and what I eventually did. I accepted my own answer and not his since like I said, I don't use Gradle so I did not use what he wrote.
最后我做了几件事.可能的解决方案是:
I did several things for it to work in the end. Possible solutions are:
首先适用于Gradle用户:
First for Gradle users:
1)将支持库还原为较旧的版本,因为该版本存在错误.
1) Revert the support library to an older version, since this one has a bug.
2)使用编译'com.android.support:appcompat-v7:23.2.1'修正错误.
2) use compile 'com.android.support:appcompat-v7:23.2.1' as the bug was fixed there.
3)对于Gradle插件2.0:
3) for Gradle Plugin 2.0:
android {
defaultConfig {
vectorDrawables.useSupportLibrary = true
}
}
或者您可以使用成绩构建工具1.5.0(classpath 'com.android.tools.build:gradle:1.5.0'
)
Or you can use Grade Build Tools 1.5.0 (classpath 'com.android.tools.build:gradle:1.5.0'
)
defaultConfig {
generatedDensities = []
}
///不需要Gradle 2.0
// no need for this with Gradle 2.0
aaptOptions {
additionalParameters "--no-version-vectors"
}
这是非Gradle用户的一部分:
This is the part for non Gradle users:
1)打开SDK管理器.
1) Open SDK manager.
2)从API 22和23卸载了两个"Android Wear X"(其中X是ARM或Intel).
2) Uninstalled both "Android Wear X" (where X is ARM or Intel) from APIs 22 and 23.
3)然后,我仍然使用AppCompat库的一种样式出现编译错误.我只是将它们注释掉了(如果使用非常特定的样式,我会冒险使用非常特定的设备无法正常工作).
3) I then still had a compilation error in one of the styles of the AppCompat library. I simply commented them out (I'll risk the very specific device not working if it uses that very specific style).
此后,我清理了该项目,它开始工作.
After that I cleaned the project and it just started to work.
这篇关于XmlPullParserException二进制XML文件行#17< vector>标签需要viewportWidth> 0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!