gpt4 book ai didi

android - 任务 ':react-native-svg:verifyReleaseResources' 的 React-Native 执行失败

转载 作者:太空宇宙 更新时间:2023-11-03 11:23:48 32 4
gpt4 key购买 nike

在 React-Native Android Emulator 中,它可以完美运行。但是,当我运行以下命令时:

cd android && ./gradlew assembleRelease

我收到这个错误,我不知道该怎么办

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

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

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

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

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

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

error: failed linking references.

编辑:更多信息

当我执行上述命令时,我也得到了这个:

Configure project :react-native-svg 
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
WARNING: The specified Android SDK Build Tools version (23.0.1) is ignored, as it is below the minimum supported version (27.0.3) for Android Gradle Plugin 3.1.4.
Android SDK Build Tools 27.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '23.0.1'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.

打包.e.json

  "react-native-svg": "^6.3.1",
"react-native": "^0.57.1"
}
"devDependencies": {
"babel-jest": "23.2.0",
"babel-preset-react-native": "4.0.0",
"jest": "23.2.0",
"react-test-renderer": "16.3.1"
}

最佳答案

对于 RN 0.57 这应该有效:

minSdkVersion = 17
compileSdkVersion = 27
targetSdkVersion = 27
supportLibVersion = "27.0.3"

classpath 'com.android.tools.build:gradle:3.1.4'

Gradle 4.4

`distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip`

同时检查 0.57 和 babel deps 的 RN changeLog,确保你使用的是 babel 7。

React native upgrade from babel 6 to babel 7

同时尝试清理缓存:rm -rf $TMPDIR/react-* && rm -rf $TMPDIR/metro-* && rm -rf $TMPDIR/haste-* && watchman watch-del-all && rm -rf ios/build && rm -rf node_modules && yarn install && npm start -- --reset-cache

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

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