mardi 5 novembre 2019

Espresso InflateException for ImageButton when using `?attr/`

I have an ImageButton like this

  <ImageButton
            ...
            style="@style/buttonStyle" />

where buttonStyle looks like this;

 <style name="buttonStyle">
        ...
        <item name="android:background">?attr/selectableItemBackgroundBorderless</item>
        ...
    </style>

When this ImageButton is displayed within Espresso tests, it throws

android.view.InflateException ... Error inflating class android.widget.ImageButton

When I remove android:background attribute, it works fine.

Is there something I'm missing about Android resources on Espresso tests?

Aucun commentaire:

Enregistrer un commentaire