Resource android:attr/colorError not found


#1

I’m working on a plugin that uses Stripe, writing on Mac OSX. It’s working for ios but not android.

When I go through the instructions at https://docs.nativescript.org/plugins/building-plugins and create a local copy of nativescript-version-number I can run successfully on an Android emulator. (Installed using Android Studio.)

If I then make just one change, to include.gradle, it no longer builds. Add the following to the dependencies block:

    compile 'com.stripe:stripe-android:8.0.0'

npm run plugin.tscwatch compiles but npm run demo.android fails to build with error:

Error: Command ./gradlew failed with exit code 1 Error output:
 ~/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.1.0.aar/bf7a4c30edcd7fbace87de38a1ae35a7/res/values-v26/values-v26.xml:9:5-12:13: AAPT: error: resource android:attr/colorError not found.

followed by a number of similar errors.

(I tried a clean build with the same result.)

Any suggestions?


#2

This worked for me - specify the compileSdkVersion and buildToolsVersion on app.gradle like this

android {
  compileSdkVersion 27
  buildToolsVersion '27.0.3'
}

and do a tns platform remove android before rebuilding.


#3

Although I found this wasn’t necessary for me, it did help me figure out what to do. I had to install and target an emulator running Oreo, not Lollipop (the version I eventually want to target).