gpt4 book ai didi

android - 任务 ':react-native-get-sms-android:verifyReleaseResources' 的 React Native 构建错误执行失败

转载 作者:太空狗 更新时间:2023-10-29 16:10:43 25 4
gpt4 key购买 nike

我在安装“react-native-get-sms-android”后构建 React Native 时遇到问题,您可以在这里找到 https://www.npmjs.com/package/react-native-get-sms-android ,我不知道为什么,我试图寻找类似的错误,但都失败了。

这是完整的错误:

> Task :app:processReleaseGoogleServices
Parsing json file: D:\Project\React Native\myProject\android\app\google-services.json

error: resource android:style/TextAppearance.Material.Widget.Button.Borderless.Colored not found.
error: resource android:style/TextAppearance.Material.Widget.Button.Colored not found.
C:\Users\frank\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar\226ef6010c3c969192062affc53f6ce6\res\values-v26\values-v26.xml:9:5-12:13: AAPT: error: resource android:attr/colorError not found.

C:\Users\frank\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar\226ef6010c3c969192062affc53f6ce6\res\values-v26\values-v26.xml:13:5-16:13: AAPT: error: resource android:attr/colorError not found.

C:\Users\frank\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar\226ef6010c3c969192062affc53f6ce6\res\values-v26\values-v26.xml:17:5-93: AAPT: error: style attribute 'android:attr/keyboardNavigationCluster' not found.

C:\Users\frank\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar\226ef6010c3c969192062affc53f6ce6\res\values\values.xml:251:5-69: AAPT: error: resource android:attr/fontStyle not found.

C:\Users\frank\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar\226ef6010c3c969192062affc53f6ce6\res\values\values.xml:251:5-69: AAPT: error: resource android:attr/font not found.

C:\Users\frank\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar\226ef6010c3c969192062affc53f6ce6\res\values\values.xml:251:5-69: AAPT: error: resource android:attr/fontWeight not found.

error: failed linking references.

FAILURE: Build failed with an exception.

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

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 3m 54s
203 actionable tasks: 4 executed, 199 up-to-date

请任何人帮助我解决这个问题。

谢谢。

最佳答案

错误原因:

你已经安装了 react-native-get-sms-android 作为依赖项,这个错误的原因是你的 android/app/build.gradle 的配置和 node_modules/react-native-get-sms-android/android/build.gradle不匹配。

解决方案

  1. 导航到 node_modules/react-native-get-sms-android/android/build.gradle
  2. 编辑并保留 compileSdkVersion buildToolsVersion minSdkVersion
    targetSdkVersion
    与您在 android/app/build.gradle 中的相同
  3. 再次同步项目。
  4. 运行 ./gradlew assembleRelease从终端。

关于android - 任务 ':react-native-get-sms-android:verifyReleaseResources' 的 React Native 构建错误执行失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53370968/

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