【发布时间】:2019-09-17 07:11:17
【问题描述】:
自从我在 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 功能?
提前致谢
科比
【问题讨论】:
-
需要删除C:\projects\react-native-sample-with-redux\android\app\build\generated\res\resValues\debug\values\gradleResValues.xml
标签: react-native gradle