Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AAPT: error: resource android:attr/colorError not found

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?

like image 845
user9173787 Avatar asked Aug 22 '18 19:08

user9173787


2 Answers

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.

like image 108
joelreeves Avatar answered Oct 06 '22 14:10

joelreeves


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"  
  }  
} 
like image 45
Ramsés J Avatar answered Oct 06 '22 15:10

Ramsés J