apptentive / apptentive-android

Apptentive Android SDK
http://www.apptentive.com
BSD 3-Clause "New" or "Revised" License
65 stars 64 forks source link

Updating android platform compile sdk to android-p causes 'attr/textColorError' not found error #149

Closed breakingthebuild closed 6 years ago

breakingthebuild commented 6 years ago

When updating our android platform compile sdk to android-p, we are getting this error 'attr/textColorError' not found. This line is the culprit:

https://github.com/apptentive/apptentive-android/blob/master/apptentive/src/main/res/values/themes.xml#L150

<!-- Needed since design support library 23.2.0 -->
<item name="textColorError">@color/apptentive_validation_failed_color</item>
weeeBox commented 6 years ago

Hey @breakingthebuild. Sorry for the late reply: we're looking at the issue right now.

weeeBox commented 6 years ago

@breakingthebuild, which buildToolsVersion, targetSdkVersion and minSdkVersion do you use? Would you be able to share your build.gradle file?

breakingthebuild commented 6 years ago

@weeeBox Thanks for looking into this issue. Below are the gradle settings you asked for:

minSdkVersion = 21
buildToolsVersion = 27.0.3
targetSdk = 26
weeeBox commented 6 years ago

@breakingthebuild, thanks for the info. We'll look into it ASAP

weeeBox commented 6 years ago

@breakingthebuild, we're not able to reproduce the issue on our end. I've created a small test project with the same configuration as yours. Would you be able to check if you can build it?

It would also be helpful if you can send us your build.gradle file.

Test-Apptentive.zip

weeeBox commented 6 years ago

Hi @breakingthebuild,

Did you have a chance to look at the issue?

ThePromoter commented 6 years ago

Hey @weeeBox sorry that we didn't respond in time. I was able to slightly alter your sample project and cause the error. The key change was including implementation 'com.android.support:appcompat-v7:28.0.0-alpha1' in your gradle file. We'd like to use this support library version so that we can take advantage of the new Chip and ChipGroup controls.

Test-Apptentive.zip

weeeBox commented 6 years ago

Thanks @ThePromoter.

We'll take a look at it

breakingthebuild commented 6 years ago

@weeeBox Hey Sorry for the lack of response on my part. Curious if you were able to reproduce this issue?

weeeBox commented 6 years ago

@breakingthebuild, yes, I was able to reproduce it. Looking for a solution now...

breakingthebuild commented 6 years ago

@weeeBox Awesome! Thanks for the quick response.

weeeBox commented 6 years ago

Hi, @breakingthebuild.

Here's a temporary fix (will incorporate it in the next SDK release): Create a new xml file <your_app_module>/src/main/res/values-v27/apptentive-attrs-fix.xml with the following content:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <declare-styleable name="ApptentiveThemeTemplate">
        <attr name="textColorError" format="color|reference"/>
    </declare-styleable>
</resources>

Let me know if it helps!

breakingthebuild commented 6 years ago

That worked. Thanks @weeeBox

weeeBox commented 6 years ago

Great! Thanks for your help! The fix is available in 5.1.4 release

lennonpetrick commented 5 years ago

Hey guys, I had the same issue in my project. It seems appcompat has changed textColorError attribute. Now it's using colorError instead.

weeeBox commented 5 years ago

Hi @lennonpetrick,

What are your compileSdkVersion, buildToolsVersion and targetSdkVersion?

lennonpetrick commented 5 years ago

It's compileSdkVersion 28 , buildToolsVersion 27.0.3 and targetSdkVersion 28.

I think you misunderstood me lol. I am not using your product. I was just looking for a solution for my problem when I came across with this git issue. So after finding the solution I thought would be good to comment here for helping someone else.

weeeBox commented 5 years ago

Hey @lennonpetrick,

Yes, I've totally misread that 🤦! Thanks for your hint, we'll take a closer look!