XmlPullParserException Binary XML file line #17

2020-06-30 06:28发布

This is a follow up question to this question:

Update Android Support Library to 23.2.0 cause error: XmlPullParserException Binary XML file line #17<vector> tag requires viewportWidth > 0

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

That question solved it for Android Studio and Gradle. How can this be solved when using Eclipse without Gradle?

7条回答
萌系小妹纸
2楼-- · 2020-06-30 07:32

You can either switch back to the previous version of the appcompat library (Quick fix):

compile 'com.android.support:appcompat-v7:23.1.1'

Or keep the current library version and make the appropriate update to your build gradle file as explained by google in version 23.2.0 release note.

//for Gradle Plugin 2.0+  
android {  
    defaultConfig {  
        vectorDrawables.useSupportLibrary = true  
    }  
}

If you are using Gradle 1.5 you’ll instead use

defaultConfig {
    generatedDensities = []
}

// This is handled for you by the 2.0+ Gradle Plugin
aaptOptions {
    additionalParameters "--no-version-vectors"
}

Don't forget to update your gradle build tool to version 1.5.0 at least or you couldn't use the new parameters like generatedDensities:

classpath 'com.android.tools.build:gradle:1.5.0'

More infos on why here

查看更多
登录 后发表回答