Invalid drawable tag vector

后端 未结 14 1067
小蘑菇
小蘑菇 2020-12-28 12:34

Im trying to use vector drawables on pre lollipop devices. I did all as instructed here but i still get this crash.

build.gradle:

14条回答
  •  星月不相逢
    2020-12-28 13:03

    If you have this exception issue with drawableLeft,drawableRight,drawableTop, drawableXxx etc... And your project buildToolsVersion > 26.0.2.

    Go check your app level gradle file, remove vectorDrawables.useSupportLibrary = true if exists, then crash gone.

    This because buildTools will dispose vector resource after 26.0.2, but somehow conflict with vectorDrawables.useSupportLibrary = true.

    Tested at 2019/03/27.

    (if you can't find your buildToolsVersion in you app level gradle file, this mean you're using Android plugin for Gradle 3.0.0 or higher, your project automatically uses a default version of the build tools that the plugin specifies. In this case your buildToolsVersion already large than 26.0.2)

提交回复
热议问题