6

I'm executing "tns run android" on a NativeScript project but I'm getting the following errors:

C:\Users\jim\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.0.2.aar\462a                                                                                                                 922193e097e31bddc3aa6795fc06\res\values-v26\values-v26.xml:9:5-12:13: AAPT: error: resource android:attr/colorError not found.

C:\Users\jim\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.0.2.aar\462a                                                                                                                 922193e097e31bddc3aa6795fc06\res\values-v26\values-v26.xml:13:5-16:13: AAPT: error: resource android:attr/colorError not found.

C:\Users\jim\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.0.2.aar\462a                                                                                                                 922193e097e31bddc3aa6795fc06\res\values-v26\values-v26.xml:17:5-93: AAPT: error: style attribute 'android:attr/keyboardNavigationCluster' not found.

C:\Users\jim\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.0.2.aar\462a                                                                                                                 922193e097e31bddc3aa6795fc06\res\values\values.xml:252:5-69: AAPT: error: resource android:attr/fontStyle not found.

C:\Users\jim\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.0.2.aar\462a                                                                                                                 922193e097e31bddc3aa6795fc06\res\values\values.xml:252:5-69: AAPT: error: resource android:attr/font not found.

C:\Users\jim\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.0.2.aar\462a                                                                                                                 922193e097e31bddc3aa6795fc06\res\values\values.xml:252:5-69: AAPT: error: resource android:attr/fontWeight not found.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> Failed to process resources, see aapt output above for details.

I'm new to NativeScript and to Android development. What are the recommended steps to debug/fix this error?

user9173787
  • 139
  • 1
  • 1
  • 4

2 Answers2

3

I believe colorError was introduced in support version 28.0.0. Since it looks like you're using 27.0.2 you can just use textColorError instead.

joelreeves
  • 1,955
  • 1
  • 18
  • 24
2

You need to change Android's SDK version to 26

app/App_Resources/Android/app.gradle

android {
  compileSdkVersion 26
  buildToolsVersion "26.0.3"
  defaultConfig {  
    generatedDensities = []
    applicationId = "org.nativescript.blankng"  
  }  
  aaptOptions {  
    additionalParameters "--no-version-vectors"  
  }  
} 
Ramsés J
  • 357
  • 2
  • 5