Android XML: RuntimeException: Failed to resolve attribute at index 6

Ran into this problem myself. It’s because my app isn’t using AppCompat yet, still just the regular support FragmentActivity. This means that FloatingActionButton was looking for two theme attributes and it couldn’t find them.

Specifically adding in these missing attributes made it work for me without the need to start using AppCompat.

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

    <android.support.design.widget.FloatingActionButton
        ...
        app:backgroundTint="@color/{some color statelist}"
        app:rippleColor="@color/{some color statelist}"
        ... />

</LinearLayout>

Leave a Comment