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

前端 未结 7 1812
轻奢々
轻奢々 2021-02-18 15:31

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 tag re

7条回答
  •  梦谈多话
    2021-02-18 15:58

    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

提交回复
热议问题