PagerSlidingTabStrip icon indicating copy to clipboard operation
PagerSlidingTabStrip copied to clipboard

Use newer build tools to prevent crash when using in a project with com.android.tools.build:gradle:3.0.0-beta2

Open ChristophKaser opened this issue 8 years ago • 5 comments

Currently, when this library is used with the newest android gradle plugin (com.android.tools.build:gradle:3.0.0-beta2), the app crashes when the PagerSlidingTabStrip is inflated:

java.lang.UnsupportedOperationException: Can't convert value at index 1 to color: type=0x5 at android.content.res.TypedArray.getColor(TypedArray.java:480) at com.astuetz.PagerSlidingTabStrip.<init>(PagerSlidingTabStrip.java:144) at com.astuetz.PagerSlidingTabStrip.<init>(PagerSlidingTabStrip.java:106)

This is caused by the following bug in the old build tools: https://issuetracker.google.com/issues/64472743

This PR fixes the problem by building the library with newer buildtools

ChristophKaser avatar Aug 23 '17 15:08 ChristophKaser

Have the same issue!

vovander avatar Oct 10 '17 14:10 vovander

I had the same issue. I applied the solution and it worked like a charm. Thanks for the help @ChristophKaser, you saved my monday.

rogerioit avatar Oct 30 '17 12:10 rogerioit

Thanks @ChristophKaser

In the meantime, if switching from 2.3.0 to 3.0.0 of com.android.tools.build:gradle it is also necessary to change maven repository from jcenter() to google().

hgoebl avatar Nov 05 '17 07:11 hgoebl

It seems the author is not actively working on this project right now.

How can I make gradle use a modified version of this lib?

currently compile 'com.astuetz:pagerslidingtabstrip:1.0.1'

jiangbodev avatar Nov 10 '17 00:11 jiangbodev

You can use jitpack.io:

repositories {
    maven { url "https://jitpack.io" }
}

dependencies {
    compile 'com.github.ChristophKaser:PagerSlidingTabStrip:d924189a70'
}

ChristophKaser avatar Nov 10 '17 08:11 ChristophKaser