XmlPullParserException Binary XML file line #17<vector> tag requires viewportWidth > 0

Yonatan Nir picture Yonatan Nir · Feb 27, 2016 · Viewed 16.8k times · Source

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?

Answer

Gomino picture Gomino · Mar 2, 2016

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