gpt4 book ai didi

react-native - react native 的 gradle 升级

转载 作者:行者123 更新时间:2023-12-03 03:26:09 27 4
gpt4 key购买 nike

自从我在 Android Studio 中升级了 Gradle 组件后,我就无法编译我的 React Native 应用程序。
这是错误消息:

error React Native CLI uses autolinking for native dependencies, but the following modules are 
linked manually:
- react-native-gesture-handler (to unlink run: "react-native unlink react-native-gesture-handler")
This is likely happening when upgrading React Native from below 0.60 to 0.60 or above. Going
forward, you can unlink this dependency via "react-native unlink <dependency>" and it will be
included in your app automatically. If a library isn't compatible with autolinking, disregard this
message and notify the library maintainers.
Read more about autolinking: https://github.com/react-native-
community/cli/blob/master/docs/autolinking.md
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier"
flag.
Jetifier found 919 file(s) to forward-jetify. Using 4 workers...
info JS server already running.
info Installing the app...

> Task :app:mergeDebugResources FAILED
[integer/react_native_dev_server_port] C:\projects\react-native-sample-with-
redux\android\app\build\generated\res\resValues\debug\values\generated.xml
[integer/react_native_dev_server_port] C:\projects\react-native-sample-with-
redux\android\app\build\generated\res\resValues\debug\values\gradleResValues.xml: Error: Duplicate
resources
[integer/react_native_inspector_proxy_port] C:\projects\react-native-sample-with-
redux\android\app\build\generated\res\resValues\debug\values\generated.xml
[integer/react_native_inspector_proxy_port] C:\projects\react-native-sample-with-
redux\android\app\build\generated\res\resValues\debug\values\gradleResValues.xml: Error:
Duplicate resources

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.4.1/userguide/command_line_interface.html#sec:command_line_warnings
18 actionable tasks: 1 executed, 17 up-to-date

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> [integer/react_native_dev_server_port] C:\projects\react-native-sample-with-
redux\android\app\build\generated\res\resValues\debug\values\generated.xml
[integer/react_native_dev_server_port] C:\projects\react-native-sample-with-
redux\android\app\build\generated\res\resValues\debug\values\gradleResValues.xml: Error: Duplicate
resources
[integer/react_native_inspector_proxy_port] C:\projects\react-native-sample-with-
redux\android\app\build\generated\res\resValues\debug\values\generated.xml
[integer/react_native_inspector_proxy_port] C:\projects\react-native-sample-with-
redux\android\app\build\generated\res\resValues\debug\values\gradleResValues.xml: Error: Duplicate
resources

如何升级应用中的 Gradle 设置以适应新的 Gradle 功能?

提前致谢

科比

最佳答案

React-native 版本 > 0.6,一些依赖会自动链接,我们不需要使用 react-native 链接依赖,但有些不兼容自动链接,像这样:

error React Native CLI uses autolinking for native dependencies, but the following modules are linked manually:
- react-native-vector-icons (to unlink run: "react-native unlink react-native-vector-icons")
This is likely happening when upgrading React Native from below 0.60 to 0.60 or above. Going forward, you can unlink this dependency via "react-native unlink <dependency>" and it will be included in your app automatically. If a library isn't compatible with autolinking, disregard this message and notify the library maintainers.
Read more about autolinking: https://github.com/react-native-community/cli/blob/master/docs/autolinking.md
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.


到目前为止,解决此问题的最佳方法是返回低于 0.6 的 react-native 版本并重新安装。

关于react-native - react native 的 gradle 升级,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57969082/

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