Aapt error resource android attr colorerror not found

After upgrading my compileSdkVersion, TargetSdkVersion and libraries version to 28. My project won't build any more. I'm currently build specifically for 'mFlavor' so please ignore other flavors. M...

After upgrading my compileSdkVersion, TargetSdkVersion and libraries version to 28. My project won’t build any more. I’m currently build specifically for ‘mFlavor’ so please ignore other flavors. Manaul command gradlew assembleMFlavorDebug

Here is my build.gradle (Project level)

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        google()
        mavenCentral()
        maven {url 'https://maven.fabric.io/public'}
        jcenter()
    }



    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
        /*classpath 'com.google.gms:google-services:3.1.1'*/
        classpath 'com.google.gms:google-services:4.2.0'
        // classpath 'com.google.gms:google-services:2.0.0-alpha3'

        classpath 'io.fabric.tools:gradle:1.25.4'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        maven { url "https://maven.google.com"}
        maven{url "https://jitpack.io"}
        google()
        jcenter()
    }
}

Here is my build.gradle (App level)

apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

repositories{
    maven {url 'https://maven.fabric.io/public'}
    mavenCentral()
    maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
// Create a variable called keystorePropertiesFile, and initialize it to your
// keystore.properties file, in the rootProject folder.
def keystorePropertiesFile = rootProject.file('keystore.properties')

// Initialize a new Properties() object called keystoreProperties.
def keystoreProperties = new Properties()

// Load your keystore.properties file into the keystoreProperties object.
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))

android {
    flavorDimensions "default"

    buildToolsVersion '28.0.3'
    compileSdkVersion 28
    defaultConfig {

        targetSdkVersion 27


        versionCode 19
        versionName "1.0"

        // If you have different applicationIds for buildTypes or productFlavors uncomment this block.
        javaCompileOptions {
            annotationProcessorOptions {
                arguments = ["resourcePackageName": android.defaultConfig.applicationId]
            }
        }

        vectorDrawables.useSupportLibrary = true
        /*resConfigs "en", "ar"*/
    }
    buildTypes {
        release {
            // remove unused resources
            shrinkResources true
            // remove unused code
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            debuggable false
            jniDebuggable false
            //signingConfig signingConfigs.config
            renderscriptDebuggable false
            zipAlignEnabled true
        }
        debug {
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    lintOptions {
        //checkReleaseBuilds false
        disable 'MissingTranslation'
        disable 'ExtraTranslation'

    }
    /*aaptOptions{
        cruncherEnabled = false
    }*/
    productFlavors {
        tFLavor {
            compileSdkVersion 22
            applicationId "com.tyu"
            versionName "1.0.0"
            versionCode 20

        }
        oFlavor {
            compileSdkVersion 22
            applicationId "com.op"
            versionName = "1.2.0"
        }

        mFlavor {
            minSdkVersion 16
            compileSdkVersion 28
            targetSdkVersion 28
            applicationId "pk.com.mnb"
            versionName = "4.0.2"
            versionCode = 55

        }

        wFlavor {
            minSdkVersion 14
            compileSdkVersion 22
            applicationId "com.wer"
            versionName = "1.0"
            versionCode = 1
        }
        uFlavor {
            compileSdkVersion 22
            applicationId "com.uio"
            versionName = "1.0"
        }
        zFlavor {
            minSdkVersion 14
            compileSdkVersion 26
            targetSdkVersion 26
            applicationId "com.abc"
            versionName = "1.0.2"
            versionCode = 4


        }

        motoFlavor {
            minSdkVersion 14
            compileSdkVersion 25
            targetSdkVersion 25
            applicationId "pk.com.xyz"
            versionName = "2.2.2"
            versionCode = 26


        }
    }
    //compileSdkVersion 27
}

repositories{
    mavenCentral()
    mavenLocal()
    flatDir{
        dirs '/src/mnb/libs', '/src/zxc/libs'
    }
}

//def AAVersion = "4.4.0"
def AAVersion = "4.5.2"
dependencies {
    annotationProcessor "org.androidannotations:androidannotations:$AAVersion"
    implementation "org.androidannotations:androidannotations-api:$AAVersion"
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:design:28.0.0'
    // compile 'com.android.support:cardview-v7:23.1.1'
    implementation 'com.android.support:support-v13:28.0.0'
    /*implementation 'com.intuit.sdp:sdp-android:1.0.6'*/
    implementation 'com.google.code.gson:gson:2.8.0'
    // implementation 'com.google.code.gson:gson:2.8.0'
    // compile files('libs/activeandroid-3.1-beta.jar')
    implementation 'com.google.android.gms:play-services-maps:16.1.0'
    implementation 'com.google.android.gms:play-services-gcm:16.1.0'
    implementation 'com.android.support:gridlayout-v7:28.0.0'
    implementation 'de.hdodenhof:circleimageview:2.2.0'
    /*   implementation 'com.google.android.gms:play-services-analytics:11.0.0'*/
    //implementation 'com.android.support:multidex:1.0.1'
    /*compile 'com.google.zxing:core:3.0.1'*/
    /* compile files('libs/android-core-3.2.1.jar')
                                                    compile files('libs/core-3.2.1.jar') */
    implementation 'net.hockeyapp.android:HockeySDK:5.1.0'

    implementation 'com.facebook.android:facebook-android-sdk:4.6.0'

    implementation('com.github.chrisbanes:PhotoView:1.3.0') {
        exclude module: 'support-v4'
    }
    //mobilinkCompile 'com.facebook.android:facebook-android-sdk:4.14.0@aar'
    uFlavorImplementation('com.twitter.sdk.android:twitter:2.2.0@aar') {
        transitive = true
        exclude module: 'support-v4'
    }
    implementation 'com.michaelpardo:activeandroid:3.1.0-SNAPSHOT'
    implementation 'com.google.firebase:firebase-core:16.0.8'
}

apply plugin: 'com.google.gms.google-services'

And here is my gradle build error logs

E:PersonalProjectNameappbuildintermediatesincrementalmergeFlavorNameDebugResourcesmerged.dirvalues-v26values-v26.xml:7: error: resource android:attr/colorError not found.
  E:PersonalProjectNameappbuildintermediatesincrementalmergeFlavorNameDebugResourcesmerged.dirvalues-v26values-v26.xml:11: error: resource android:attr/colorError not found.
  E:PersonalProjectNameappbuildintermediatesincrementalmergeFlavorNameDebugResourcesmerged.dirvalues-v26values-v26.xml:15: error: style attribute 'android:attr/keyboardNavigationCluster' not found.
  E:PersonalProjectNameappbuildintermediatesincrementalmergeFlavorNameDebugResourcesmerged.dirvalues-v28values-v28.xml:7: error: resource android:attr/dialogCornerRadius not found.
  E:PersonalProjectNameappbuildintermediatesincrementalmergeFlavorNameDebugResourcesmerged.dirvalues-v28values-v28.xml:11: error: resource android:attr/dialogCornerRadius not found.
  C:UsersUserName.gradlecachestransforms-1files-1.1design-28.0.0.aar51e52ea0f459299746be071f693e7a44resvaluesvalues.xml: AAPT: error: style attribute 'android:attr/keyboardNavigationCluster' not found.

  C:UsersUserName.gradlecachestransforms-1files-1.1appcompat-v7-28.0.0.aar9f002bd341f5fe5ec616948fde22969dresvaluesvalues.xml: AAPT: error: resource android:attr/keyboardNavigationCluster not found.

  C:UsersUserName.gradlecachestransforms-1files-1.1appcompat-v7-28.0.0.aar9f002bd341f5fe5ec616948fde22969dresvaluesvalues.xml: AAPT: error: resource android:attr/fontStyle not found.

  C:UsersUserName.gradlecachestransforms-1files-1.1appcompat-v7-28.0.0.aar9f002bd341f5fe5ec616948fde22969dresvaluesvalues.xml: AAPT: error: resource android:attr/font not found.

  C:UsersUserName.gradlecachestransforms-1files-1.1appcompat-v7-28.0.0.aar9f002bd341f5fe5ec616948fde22969dresvaluesvalues.xml: AAPT: error: resource android:attr/fontWeight not found.

  C:UsersUserName.gradlecachestransforms-1files-1.1appcompat-v7-28.0.0.aar9f002bd341f5fe5ec616948fde22969dresvaluesvalues.xml: AAPT: error: resource android:attr/fontVariationSettings not found.

  C:UsersUserName.gradlecachestransforms-1files-1.1appcompat-v7-28.0.0.aar9f002bd341f5fe5ec616948fde22969dresvaluesvalues.xml: AAPT: error: resource android:attr/ttcIndex not found.

  error: failed linking references.
  Command: C:UsersUserName.gradlecachestransforms-1files-1.1aapt2-3.2.1-4818971-windows.jar6d9ed65b6dd5edf0927b82048b67f6e3aapt2-3.2.1-4818971-windowsaapt2.exe link -I
          D:AndroidSDKplatformsandroid-25android.jar
          --manifest
          E:PersonalProjectNameappbuildintermediatesmerged_manifestsFlavorNameDebugprocessFlavorNameDebugManifestmergedAndroidManifest.xml
          -o
          E:PersonalProjectNameappbuildintermediatesprocessed_resFlavorNameDebugprocessFlavorNameDebugResourcesoutresources-FlavorNameDebug.ap_
          -R
          @E:PersonalProjectNameappbuildintermediatesincrementalprocessFlavorNameDebugResourcesresources-list-for-resources-FlavorNameDebug.ap_.txt
          --auto-add-overlay
          --java
          E:PersonalProjectNameappbuildgeneratednot_namespaced_r_class_sourcesFlavorNameDebugprocessFlavorNameDebugResourcesr
          --custom-package
          com.ooredoo.ProjectName
          -0
          apk
          --output-text-symbols
          E:PersonalProjectNameappbuildintermediatessymbolsFlavorNamedebugR.txt
          --no-version-vectors
  Daemon:  AAPT2 aapt2-3.2.1-4818971-windows Daemon #0

You can come across aapt: error: resource android:attr/colorerror not found. error while building your react native Android app or while generating APK file from your React Native project. This issue occurs when third-party libraries use compileSdkVersion and buildToolsVersion less than 26.

You can solve this react native issue by forcing sub-projects to use SDK version greater than 26. Just open android/build.gradle file and add the following code inside allprojects tag.

allprojects {
    repositories {
        google()
        mavenLocal()
        jcenter()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        }
    }
    //add the folllowing lines to force libs to use recent buildtools
    subprojects {
        afterEvaluate {
            project ->
                if (project.hasProperty("android")) {
                    android {
                        compileSdkVersion = 27
                        buildToolsVersion = "27.0.3"
                    }
                }
        }
    }
}

@AdamZaczek 我使用了这种方式。解决了我的问题!
android/build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext {
buildToolsVersion = «28.0.3»
minSdkVersion = 19
compileSdkVersion = 28
targetSdkVersion = 28
supportLibVersion = «28.0.0»
}
repositories {
google()
jcenter()
}
dependencies {
classpath ‘com.android.tools.build:gradle:3.3.1’
classpath ‘com.google.gms:google-services:3.1.2’

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

}
allprojects {
repositories {
mavenLocal()
jcenter()
maven { url «https://jitpack.io» }
google()
maven { url ‘https://maven.google.com’
name ‘Google’
}
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url «$rootDir/../node_modules/react-native/android»
}
}

subprojects {
    afterEvaluate {
                android {
                    compileSdkVersion 28
                    buildToolsVersion "28.0.3"

                    defaultConfig {
                        targetSdkVersion 28
                    }
                }
    }
    // project.configurations.all {
    //     resolutionStrategy.eachDependency { details ->
    //         if (details.requested.group == 'com.android.support'
    //             && !details.requested.name.contains('multidex') ) {
    //         details.useVersion "27.0.3"
    //         }
    //     }

    //     afterEvaluate {
    //             android {
    //                 compileSdkVersion 28
    //                 buildToolsVersion "28.0.3"

    //                 defaultConfig {
    //                     targetSdkVersion 28
    //                 }
    //             }
    //         }
    // }
}

}

Android resource linking failed
G:workviewPagerappbuildintermediatesincrementalmergeDebugResourcesmerged.dirvaluesvalues.xml:622: error: resource color/colorPrimary (aka com.example.viewpager:color/colorPrimary) not found.
G:workviewPagerappbuildintermediatesincrementalmergeDebugResourcesmerged.dirvaluesvalues.xml:623: error: resource color/colorPrimaryDark (aka com.example.viewpager:color/colorPrimaryDark) not found.
G:workviewPagerappbuildintermediatesincrementalmergeDebugResourcesmerged.dirvaluesvalues.xml:624: error: resource color/colorAccent (aka com.example.viewpager:color/colorAccent) not found.
error: failed linking references.

Reason

25 below compileSdkVersion implementation ‘com. Android. Support: appcompat – v7:27.0.0’ version of the support.
error is usually reported when the compiled version of SDK is lower than the version in the support package, but this is not always true. The error is usually reported when the resource file in the higher version of support package is not found in the lower version of SDK.

solution

changes the compileSdkVersion to be consistent with support, and it is recommended to change the compileSdkVersion 27

Read More:

Android resource linking failed
G:workviewPagerappbuildintermediatesincrementalmergeDebugResourcesmerged.dirvaluesvalues.xml:622: error: resource color/colorPrimary (aka com.example.viewpager:color/colorPrimary) not found.
G:workviewPagerappbuildintermediatesincrementalmergeDebugResourcesmerged.dirvaluesvalues.xml:623: error: resource color/colorPrimaryDark (aka com.example.viewpager:color/colorPrimaryDark) not found.
G:workviewPagerappbuildintermediatesincrementalmergeDebugResourcesmerged.dirvaluesvalues.xml:624: error: resource color/colorAccent (aka com.example.viewpager:color/colorAccent) not found.
error: failed linking references.

the reason

compileSdkVersion 25 below implementation ‘com.android.support:appcompat-v7:27.0.0’ version of the support.
sdk compiler version earlier than version generally support the package will be reported this wrong, of course, is not absolute, is generally high resource file version of the support package can not be found at the bottom of the sdk version when will the error.

solve

The compileSdkVersion version instead consistent support, proposal to change compileSdkVersion 27

Я выполняю «tns run android» в проекте NativeScript, но у меня возникают следующие ошибки:

C:Usersjim.gradlecachestransforms-1files-1.1appcompat-v7-27.0.2.aar462a                                                                                                                 922193e097e31bddc3aa6795fc06resvalues-v26values-v26.xml:9:5-12:13: AAPT: error: resource android:attr/colorError not found.

C:Usersjim.gradlecachestransforms-1files-1.1appcompat-v7-27.0.2.aar462a                                                                                                                 922193e097e31bddc3aa6795fc06resvalues-v26values-v26.xml:13:5-16:13: AAPT: error: resource android:attr/colorError not found.

C:Usersjim.gradlecachestransforms-1files-1.1appcompat-v7-27.0.2.aar462a                                                                                                                 922193e097e31bddc3aa6795fc06resvalues-v26values-v26.xml:17:5-93: AAPT: error: style attribute 'android:attr/keyboardNavigationCluster' not found.

C:Usersjim.gradlecachestransforms-1files-1.1appcompat-v7-27.0.2.aar462a                                                                                                                 922193e097e31bddc3aa6795fc06resvaluesvalues.xml:252:5-69: AAPT: error: resource android:attr/fontStyle not found.

C:Usersjim.gradlecachestransforms-1files-1.1appcompat-v7-27.0.2.aar462a                                                                                                                 922193e097e31bddc3aa6795fc06resvaluesvalues.xml:252:5-69: AAPT: error: resource android:attr/font not found.

C:Usersjim.gradlecachestransforms-1files-1.1appcompat-v7-27.0.2.aar462a                                                                                                                 922193e097e31bddc3aa6795fc06resvaluesvalues.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. Каковы рекомендуемые шаги для отладки/исправления этой ошибки?

22 авг. 2018, в 21:25

Поделиться

Источник

3 ответа

Я считаю, что colorError был представлен в версии поддержки 28.0.0. Поскольку похоже, что вы используете 27.0.2, вы можете просто использовать textColorError.

joelreeves
24 сен. 2018, в 13:34

Поделиться

Вам нужно изменить версию 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"  
  }  
} 

Ramsés Corporales Rodríguez
29 авг. 2018, в 08:48

Поделиться

Привет, я новичок в разработке для Android и импортировал проект из GitHub. Я сталкиваюсь с той же ошибкой в моей андроид студии. Я попробовал выше метод, но безрезультатно. Пожалуйста, опубликуйте новый метод для этой проблемы

premkumar
06 фев. 2019, в 16:45

Поделиться

Ещё вопросы

  • 1LWJGL — не работают списки отображения
  • 0Многократная Подача Блога
  • 0Один контроллер и более одного шаблона с ui-роутером?
  • 1Как передать классический ASP Scripting.Dictionary в библиотеку классов C # COM?
  • 0Отправить переменную JS в PHP по нажатию
  • 0Ошибка компиляции: не удалось вывести аргумент шаблона
  • 0Uncaught TypeError: Object [object Object] не имеет метода ‘fnStandingRedraw’
  • 0Переменная не подходит для чтения файлов
  • 1JSON десериализация для типов C #
  • 0Реализация где не в использовании Eloquent моделей не работает
  • 1проблемы автоматизации ПЯТОГУИ ГИМП
  • 0ngReact не может найти мой реактивный компонент
  • 0Как получить результаты из базы данных при наборе и сопоставлении всех данных?
  • 0Как сосредоточиться на первом поле ввода в диалоговом окне
  • 1Нечетная ошибка компилятора, ошибка Davlik 1 от java.net.DatagramPacket.class
  • 0Шаблон обработчика событий: неразрешенный внешний
  • 1Сортировка строк с выделением сортировки по щелчку мыши
  • 1Используйте функцию связывания дважды [дубликата]
  • 1Как переименовать элемент SOAP, отвечающий в CXF?
  • 1Selenium XPath в поиске GIF для нажатия
  • 1Несколько текстовых режимов в ASP.NET
  • 0CakePHP на MAMP: CakePHP установить и WordPress установить оба в подпапках
  • 0Как вставить данные в таблицу MySQL, используя sequeilze в express.js
  • 1Небольшая проблема с объединением / объединением фреймов данных с одинаковыми именами столбцов
  • 0не может манипулировать строкой с угловым фильтром
  • 0Невозможно PHP прочитать содержимое удаленного файла
  • 0Определить EXIF Ориентация изображения в JavaScript
  • 0Функция как для строк в стиле C, так и для c ++ std :: string
  • 1Поле benchmarkRun должно реализовывать MethodRule
  • 0Изменение скорости для каждой фигуры на холсте
  • 1Как устранить ошибки пути BindingExpression в выходных данных отладки, которые не влияют на приложение WPF?
  • 0Альтернативные реализации QSharedDataPointer и QSharedData
  • 1Создать кнопку с изображением программно
  • 1лучший способ сохранить список в Python?
  • 0Как выполнить среднее для аналогичной группы записей в MySQL
  • 0Я не могу показать несколько дней отсутствия
  • 0Angular JS, ошибка: [$ injector: nomod] Модуль ‘blogger.posts.controllers’ недоступен
  • 1Синтаксис функций ES6? [Дубликат]
  • 1Невозможно получить доступ к моему логическому списку
  • 1Сохранить значения, прежде чем закрыть приложение?
  • 0ng-таблица не работает должным образом при использовании json
  • 1Что содержится в опубликованном проекте ASP.net?
  • 1Javascript действует по-разному в inappbrowser и Chrome — неопределенные глобальные переменные
  • 0Использование userAgent для определения правильной ссылки для скачивания
  • 0Могу ли я выполнить арифметику в операторе SQL?
  • 0автозаполнение не вызывает класс действия
  • 0OpenCV — неверные результаты при доступе к Mat
  • 0C # Как подключить и отключить базу данных MySQL
  • 0PDO Подготовленные заявления и логические значения
  • 1Организация данных в DynamoDB в виде списка карт

Сообщество Overcoder

Categories

Tags

If you get AAPT: error: resource android:attr/colorError not found in your React Native Android build, add the following
code into your android/build.gradle, allprojects section:

subprojects {
    afterEvaluate {
        project ->
            if (project.hasProperty("android")) {
                android {
                    compileSdkVersion = 28
                    buildToolsVersion = "28.0.3"
                }
            }
    }
}

This code will force all packages in your project to use compile SDK and build tools version 28.

aapt: error: resource android:color/system_neutral1_1000 not found

Table of Contents
Hide
  1. Problem
  2. Solution

    1. Solution 1: Downgrading Material Component
    2. Solution 2: Upgrading compileSdkVersion

You will get aapt: error: resource android:color/system_neutral1_1000 not found when you are using Material-1.5.0-alpha03 or later and using compiledSdkVersion less than 31.

Problem

According to Material Component release notes,

  1. Make sure to update your app’s compileSdkVersion to 31 when using this version of the library.
  2. If using the new DynamicColors.java util class to apply dynamic colors on Android 12, make sure to update your app to depend on AndroidX Core version 1.6.0 or later (e.g., androidx.core:core:1.6.0) (#2353).

This release supports dynamic colors. Dynamic colors are introduced in Android S where themes and UI can dynamically update based on device wallpapers, preferences and colors.

Solution

If you are using Material Components version 1.5.0-alpha03 or later then it is necessary to set compileSdkVersion to 31 or later in gradle file. Otherwise you will get aapt: error: resource android:color/system_neutral1_1000.

Solution 1: Downgrading Material Component

You may simply downgrade version 1.5.0-alpha03 to either 1.4.0 or 1.5.0-alpha02

- implementation 'com.google.android.material:material:1.5.0-alpha03'
+ implementation 'com.google.android.material:material:1.5.0-alpha02'

Or,

implementation 'com.google.android.material:material:1.4.0'

Solution 2: Upgrading compileSdkVersion

If you need to use alpha03 or later version of material:1.5.0 then you may upgrade compileSdkVersion to 31 or later –

android {
    compileSdkVersion 31
    buildToolsVersion '30.0.2'
    ....
}

compileSdkVersion 31 in build.gradle

After using any of these solutions, you won’t get aapt: error: resource android:color/system_neutral1_1000 not found.

      aapt: error: resource android:color/system_neutral1_1000 not found ♥♥

Click here to Tweet this

This is Akash Mittal, an overall computer scientist. He is in software development from more than 10 years and worked on technologies like ReactJS, React Native, Php, JS, Golang, Java, Android etc. Being a die hard animal lover is the only trait, he is proud of.

Related Tags
  • android,
  • android error,
  • android short,
  • Error

Понравилась статья? Поделить с друзьями:
  • Aapt error is incompatible with attribute src attr reference color
  • Aapt error is incompatible with attribute background attr reference color
  • Aapt error file failed to compile
  • Aapt error failed to read png signature file does not start with png signature
  • Aae error 9178 was encountered