【问题标题】:AAPT: Error retrieving parent for item: No resource found that matches name"AAPT:检索项目的父项时出错:未找到与名称匹配的资源”
【发布时间】:2019-02-12 07:39:32
【问题描述】:

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
}

}

【问题讨论】:

    标签: react-native


    【解决方案1】:

    尝试改变你对 react native voice 的依赖

    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"
                }
            }
        }
    }
    

    【讨论】:

      猜你喜欢
      • 2017-12-27
      • 1970-01-01
      • 1970-01-01
      • 2019-07-02
      • 2017-08-09
      • 1970-01-01
      相关资源
      最近更新 更多