Crash when using color values from styles.

Author: dmitvitaliiCreated Aug 17, 2017Updated Nov 17, 2017

I'm trying to set colors like that:

app:fillColor="?attr/colorAccent"
app:pageColor="?attr/colorPrimary"
app:strokeColor="?attr/colorPrimary"

It worked before, but now it throws:

android.view.InflateException: Binary XML file line #16: Binary XML file line #17: Error inflating class com.viewpagerindicator.CirclePageIndicator caused by: java.lang.UnsupportedOperationException: Can't convert to dimension: type=0x1d

I've tried to set @color/color_primary values and '#ff00ff' color hex values: the same issue.

As a workaround: I set all needed colors in runtime by calling setFillColor(), setPageColor() and setStrokeColor() respectively.

minSdkVersion 21
targetSdkVersion 26
buildToolsVersion "26.0.0"

Source: JakeWharton/ViewPagerIndicator