首页 > 解决方案 > AAPT:错误:找不到资源 android:attr/colorError 并且找不到样式属性“android:attr/keyboardNavigationCluster”

问题描述

是的,这个问题有一百万个,但没有帮助我。我已经使缓存无效一百万次,但没有解决方案。我已经降级了 gradle 版本,但它继续出现。

这是我的 gradle 文件(模块:应用程序

apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
    applicationId "com.mtechcomm.nanocreditnative"
    minSdkVersion 19
    targetSdkVersion 29
    multiDexEnabled true
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    }
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.firebase:firebase-analytics:17.2.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.google.android.material:material:1.0.0'

implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0'

implementation 'com.android.support:multidex:1.0.3'
implementation 'com.github.IslamKhSh:CardSlider:0.4'
implementation 'androidx.multidex:multidex:2.0.1'


implementation project(':lenddodatasdk')

}

// Add to the bottom of the file
apply plugin: 'com.google.gms.google-services'

这是我的 gradle 文件(模块:项目

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


}
dependencies {
    classpath 'com.android.tools.build:gradle:3.5.3'
    classpath 'com.google.gms:google-services:4.3.2'
    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

} 所有项目 {

repositories {

    google()

    jcenter()

    maven { url 'https://jitpack.io' }

}


}

task clean(type: Delete) {

delete rootProject.buildDir
}

标签: androidandroidx

解决方案


里面的 appConfig 包括

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

我挣扎了一整天来解决这个问题并在这里找到它https://github.com/luggit/react-native-config/issues/299#issuecomment-431994106


推荐阅读