Tengo un problema al usar srcCompat en el siguiente codigo
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin"
android:background="@android:color/white"
app:srcCompat="@drawable/ic_shopping_cart_black_24dp" />
el codigo con problemas es
app:srcCompat="@drawable/ic_shopping_cart_black_24dp"
El error que tengo es:
To use VectorDrawableCompat, you need to set 'android.defaultConfig.vectorDrawables.useSupportLibrary = true'.
El principio del xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
ademas en el build.gradle lo tengo activado
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
vectorDrawables.useSupportLibrary = true