【问题标题】:AAPT: error: resource android:attr/colorError not foundAAPT:错误:找不到资源 android:attr/colorError
【发布时间】:2019-01-29 02:49:41
【问题描述】:

我在 NativeScript 项目上执行“tns run android”,但出现以下错误:

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.

我是 NativeScript 和 Android 开发的新手。调试/修复此错误的推荐步骤是什么?

【问题讨论】:

    标签: android android-studio gradle nativescript


    【解决方案1】:

    我相信colorError 是在支持版本 28.0.0 中引入的。由于您使用的是 27.0.2,因此您可以改用 textColorError

    【讨论】:

      【解决方案2】:

      您需要将Android的SDK版本改为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"  
        }  
      } 
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2019-12-26
        • 2019-05-01
        • 1970-01-01
        • 2019-07-14
        • 1970-01-01
        • 2020-11-28
        • 2022-07-02
        • 2019-12-02
        相关资源
        最近更新 更多