任务:app:mergeReleaseResources FAILED,此版本中使用了已弃用的 Gradle 功能,使其与 Gradle 7.0 不兼容
Posted
技术标签:
【中文标题】任务:app:mergeReleaseResources FAILED,此版本中使用了已弃用的 Gradle 功能,使其与 Gradle 7.0 不兼容【英文标题】:Task :app:mergeReleaseResources FAILED, Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0 【发布时间】:2021-04-22 00:14:30 【问题描述】:我正在尝试构建 android APK,但遇到此错误
> Task :app:mergeReleaseResources FAILED
[drawable-hdpi-v4/node_modules_reactnavigation_stack_src_views_assets_backicon] G:\My Projects\.RN Cli\OrderFood\android\app\src\main\res\drawable-hdpi\node_modules_reactnavigation_stack_src_views_assets_backicon.png [drawable-hdpi-v4/node_modules_reactnavigation_stack_src_views_assets_backicon] G:\My Projects\.RN Cli\OrderFood\android\app\build\generated\res\react\release\drawable-hdpi\node_modules_reactnavigation_stack_src_views_assets_backicon.png: Resource and asset merger: Duplicate resources
[drawable-mdpi-v4/node_modules_reactnativeratings_src_images_airbnbstar] G:\My Projects\.RN Cli\OrderFood\android\app\src\main\res\drawable-mdpi\node_modules_reactnativeratings_src_images_airbnbstar.png [drawable-mdpi-v4/node_modules_reactnativeratings_src_images_airbnbstar] G:\My Projects\.RN Cli\OrderFood\android\app\build\generated\res\react\release\drawable-mdpi\node_modules_reactnativeratings_src_images_airbnbstar.png: Resource and asset merger: Duplicate resources
[drawable-mdpi-v4/node_modules_reactnativeratings_src_images_airbnbstarselected] G:\My Projects\.RN Cli\OrderFood\android\app\src\main\res\drawable-mdpi\node_modules_reactnativeratings_src_images_airbnbstarselected.png [drawable-mdpi-v4/node_modules_reactnativeratings_src_images_airbnbstarselected] G:\My Projects\.RN Cli\OrderFood\android\app\build\generated\res\react\release\drawable-mdpi\node_modules_reactnativeratings_src_images_airbnbstarselected.png: Resource and asset merger: Duplicate resources
[drawable-mdpi-v4/node_modules_reactnativeratings_src_images_bell] G:\My Projects\.RN Cli\OrderFood\android\app\src\main\res\drawable-mdpi\node_modules_reactnativeratings_src_images_bell.png [drawable-mdpi-v4/node_modules_reactnativeratings_src_images_bell] G:\My Projects\.RN Cli\OrderFood\android\app\build\generated\res\react\release\drawable-mdpi\node_modules_reactnativeratings_src_images_bell.png: Resource and asset merger: Duplicate resources
Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.2/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 11m 8s
89 actionable tasks: 89 executed
【问题讨论】:
尝试选择 Build -> Rebuild project 如何选择重建?什么意思? 对不起!假设您使用的是 android studio。尝试运行 ./gradlew clean 和 ./gradlew :app:assembleDebug 【参考方案1】:你必须升级你的 Gradle
【讨论】:
以上是关于任务:app:mergeReleaseResources FAILED,此版本中使用了已弃用的 Gradle 功能,使其与 Gradle 7.0 不兼容的主要内容,如果未能解决你的问题,请参考以下文章