Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
375 views
in Technique[技术] by (71.8m points)

android - References to other resources are not supported by build-time PNG generation

AndroidStudio 3.0 / Android Gradle plugin 3.0

<vector>
  <path android:fillColor="@color/image_button_disabled"/>
</vector>

I get this error:

references to other resources are not supported by build-time PNG generation

Will it be possible to resolve it or is it a deprecated solution?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

To support API SDK < 24 add the following line to your app build.gradle inside the android block:

defaultConfig {
   vectorDrawables.useSupportLibrary = true
}

If your minSdkVersion is 24 or higher, then your issue will be resolved on its own, because VectorDrawables have full support starting with this API.

See Android Developers: Vector Drawables Backward Compatibility Solution for details.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...