Can’t process attribute android:fillColor=”@android:color/white”: references to other resources are not supported by build-time PNG generation.

升级为android studio3.0,gradle升级为4.1,报错:

Can’t process attribute android:fillColor=”@android:color/white”: references to other resources are not supported by build-time PNG generation.

那是你需要在项目的build.gradle脚本中,增加对Vector兼容性的支持

解决方法:

使用Gradle Plugin 2.0以上:
android {
    defaultConfig {
        vectorDrawables.useSupportLibrary = true
    }
}
使用Gradle Plugin 2.0以下,Gradle Plugin 1.5以上:

android {
    defaultConfig {
        // Stops the Gradle plugin’s automatic rasterization of vectors
        generatedDensities = []
    }
    // Flag to tell aapt to keep the attribute ids around
    aaptOptions {
        additionalParameters "--no-version-vectors"
    }
}
打赏