Diego Alvis
Diego Alvis

Reputation: 1855

Error with com.viewpagerindicator.CirclePageIndicator

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.

Library version compile 'com.viewpagerindicator:library:2.4.1@aar'

Source https://github.com/JakeWharton/ViewPagerIndicator/issues/424

Upvotes: 4

Views: 4991

Answers (1)

Isan Campos
Isan Campos

Reputation: 371

This happens when you update your gradle version, and this Lib isn't giving any support or having updates for more than 5 years... Despite I tried many other alternatives to keep using it, the best solution was to change it for this one: implementation 'com.github.splatte:ViewPagerIndicator:3.0.0'

More information here: https://stackoverflow.com/a/47785895/6706788 There are other options there (one telling to add "app:" on all attributes of this lib), feel free to try them too if you want, for me, the solution of the alternative lib (a branch) was the only one that worked.

Upvotes: 2

Related Questions