vectorDrawable使用报错

版权声明:转载请注明作者和出处 https://blog.csdn.net/QQ1075687690/article/details/80346823

异常信息:

Can't process attribute android:fillColor="@color/colorPrimary": references to other resources are not supported by build-time PNG generation. See http://developer.android.com/tools/help/vector-asset-studio.html for details.

解决方法:

修改 app.gradle,增加以下内容

//在gradle2.0及以上:

android {

    defaultConfig {

        vectorDrawables.useSupportLibrary = true

        }

}

//在gradle 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"

    }

}



阅读更多
想对作者说点什么?

博主推荐

换一批

没有更多推荐了,返回首页