【问题标题】:React Native Error Execution failed for task ':app:mergeReleaseResources' building APK任务':app:mergeReleaseResources'构建APK的React Native错误执行失败
【发布时间】:2020-08-27 10:44:28
【问题描述】:

我已阅读并遵循此解决方案来删除可绘制文件,但它仍然无法正常工作。 这是我关注的链接:Error Execution failed for task ':app:mergeReleaseResources' building APK

这是我按照上述方法后的错误代码:

> Task :app:mergeReleaseResources FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mergeReleaseResources'.
> [raw/app] C:\Users\User\Documents\Me\codes\Startup Project\iOrder_Merchant_recreate\android\app\src\main\res\raw\app.json     [raw/app] C:\Users\User\Documents\Me\codes\Startup Project\iOrder_Merchant_recreate\android\app\build\generated\res\react\release\raw\app.json: Error: Duplicate resources
  [raw/node_modules_reactnativevectoricons_glyphmaps_ionicons] C:\Users\User\Documents\Me\codes\Startup Project\iOrder_Merchant_recreate\android\app\src\main\res\raw\node_modules_reactnativevectoricons_glyphmaps_ionicons.json       [raw/node_modules_reactnativevectoricons_glyphmaps_ionicons] C:\Users\User\Documents\Me\codes\Startup Project\iOrder_Merchant_recreate\android\app\build\generated\res\react\release\raw\node_modules_reactnativevectoricons_glyphmaps_ionicons.json: Error: Duplicate resources

* 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

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.5/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 5m 10s

有什么帮助吗?

【问题讨论】:

  • 能否请您关闭所有节点并终止当前项目中使用的所有正在进行的进程,然后重新运行您的项目。每次都对我有用,尝试后告诉我
  • 感谢您的建议,我已经找到答案,并已将其发布在答案部分。

标签: react-native apk


【解决方案1】:

在谷歌上研究并没有找到其他类似的解决方案后,我尝试删除错误中提到的重复文件,它可以工作! 这些是我删除的 2 个文件:

  1. android\app\src\main\res\raw\app.json
  2. android\app\build\generated\res\react\release\raw\app.json

删除这两个文件后,我运行:

cd android
./gradlew assembleRelease

然后它显示我构建成功:)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-07-16
    • 2021-02-19
    • 2022-07-21
    • 1970-01-01
    • 2022-07-10
    • 2021-06-19
    • 2018-06-18
    • 1970-01-01
    相关资源
    最近更新 更多