I am making an android app with a few fragments. In one of these fragments, I have a toolbar with a back arrow as an image button.
In the XML File, I have the "app:srcCompat" attribute, but I get an error when using this attribute saying this: "To use VectorDrawableCompat, you need to set 'android.defaultConfig.vectorDrawables.useSupportLibrary = true'
In your module build.gradle
file, you need to add this line:
apply plugin: 'com.android.application'
android {
...
defaultConfig {
...
vectorDrawables.useSupportLibrary = true // This line here
}
...
}
...