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:13:13:13:13:AAPT:未找到与给定名称匹配的资源:attr 'android:keyboardNavigationCluster'。
当我将反应原生语音添加到我的项目并尝试生成 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
}
}
尝试将 React 原生语音的依赖更改为此
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"
}
}
}
}