AAPT:检索项目的父项时出错:未找到与名称匹配的资源”

时间:2019-02-12 07:39:33

标签: react-native

AAPT:检索项目的父项时出错:找不到与给定名称'android:TextAppearance.Material.Widget.Button.Borderless.Colored'匹配的资源

C:\ Users \ WindsorInfosys.gradle \ caches \ transforms-1 \ files-1.1 \ appcompat-v7-28.0.0.aar \ a454618c5126fef26c4dc0b0485e08b2 \ res \ values-v26 \ values-v26.xml:13:5- 16:13:AAPT:找不到与给定名称匹配的资源:attr'android:keyboardNavigationCluster'。

当我向项目中添加react-native-voice并尝试生成apk时,出现了此错误。

buildscript {
ext {
    buildToolsVersion = "28.0.2"
    minSdkVersion = 16
    compileSdkVersion = 28
    targetSdkVersion = 27
    supportLibVersion = "28.0.0"
}
repositories {
    google()
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:3.2.1'

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

}

1 个答案:

答案 0 :(得分:0)

尝试更改您对本机语音的依赖性

implementation(project(':react-native-voice')) {
        exclude group: 'com.android.support'
        exclude module: 'appcompat-v7'
        exclude module: 'support-v4'
 }

然后将以下代码添加到您的app / build.gradle

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