gpt4 book ai didi

javascript - 任务 ':react-native-admob:verifyReleaseResources' 执行失败

转载 作者:行者123 更新时间:2023-11-29 02:20:10 26 4
gpt4 key购买 nike

我有一个第三方依赖项 (react-native-admob),它在其 build.gradle 文件中指定了以下内容:com.google.android.gms:play-services-ads:+。查看 Google Android API 发行说明页面,2019 年 6 月 17 日对整个 com.google.android.gms API 组进行了重大更新。

我运行“./gradlew assembleDebug”时出现错误:

/Users/yons/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.1.1.aar/8cb1ac92f08bb5fb26b003aaf1d22a69/res/values/values.xml:251:5-69: AAPT: error: resource android:attr/fontVariationSettings not found.

/Users/yons/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.1.1.aar/8cb1ac92f08bb5fb26b003aaf1d22a69/res/values/values.xml:251:5-69: AAPT: error: resource android:attr/ttcIndex not found.

为了解决我的问题,我将以下内容添加到我的 android/app/build.gradle 文件中:

configurations.all {
resolutionStrategy.force 'com.google.android.gms:play-services-ads:17.2.1'
}

现在,我运行“./gradlew assembleDebug”工作正常。但是我运行'./gradlew assembleRelease'得到了一个错误:

/Users/yons/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.1.1.aar/8cb1ac92f08bb5fb26b003aaf1d22a69/res/values/values.xml:251:5-69: AAPT: error: resource android:attr/fontVariationSettings not found.

/Users/yons/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.1.1.aar/8cb1ac92f08bb5fb26b003aaf1d22a69/res/values/values.xml:251:5-69: AAPT: error: resource android:attr/ttcIndex not found.

error: failed linking references.

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':react-native-admob:verifyReleaseResources'. com.android.ide.common.process.ProcessException: Failed to execute aapt

我该如何解决?

最佳答案

根本原因是迁移到Androidx相关,google play服务更新到androidX 这个问题属于react-native-device-info?最好的选择是升级 react-native-device-info 使用

  1. yarn 升级 react-native-device-info@2.1.2
  2. cd android && gradlew clean
  3. react-native run-android

之后,您可以按照上面的答案中的说明进行更改。像这样

implementation(project(":react-native-admob"),  {
exclude group: "com.google.android.gms"
})
implementation "com.google.android.gms:play-services-ads:16.0.0"

关于javascript - 任务 ':react-native-admob:verifyReleaseResources' 执行失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56668532/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com