Question Detail

Hello Everybody,
I am Using FloatingActionButton and I want to change its inside Icon but it gives me Error To use VectorDrawableCompat, you need to set android.defaultConfig.

<android.support.design.widget.FloatingActionButton
    android:id="@+id/fab"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="end|bottom"
    android:layout_marginRight="@dimen/fab_margin"
    android:layout_marginBottom="@dimen/searchImageSize"
    app:srcCompat="@drawable/ic_adduser"/>


Thread Reply

Bili Greed

- 1 years ago

Don't

android:srcCompat="@drawable/wallpaper"

Do

app:srcCompat="@drawable/wallpaper"

as it srcCompat attribute is actually defined within AppCompat library.

Important you will need to add appropriate namespace for this.

xmlns:app="http://schemas.android.com/apk/res-auto"

Important

what you are getting it seems like it is just a lint error that can be ignored. I have tried and have the same error, but it is working correctly.

you can use tools:ignore="MissingPrefix" to avoid seeing this error temporarily.