Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native Error Execution failed for task ':app:mergeReleaseResources' building APK

I have read and follow this solution to delete drawable files but it is still not working. This is the link that I follow: Error Execution failed for task ':app:mergeReleaseResources' building APK

Here is the error code after i have followed the above method:

> 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

Any help?

like image 460
Jin Tan Avatar asked Jun 07 '26 15:06

Jin Tan


2 Answers

After researching on google and find no other similar solution, i then try to delete the duplicate files mention in the error and it works! These are the 2 files i have removed:

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

After removing these 2 files, i then run:

cd android
./gradlew assembleRelease

Then it shows me build successful :)

like image 66
Jin Tan Avatar answered Jun 09 '26 07:06

Jin Tan


You need to clean the duplicates resources.

use the following commands

rm -rf ./android/app/src/main/res/drawable-*
rm -rf ./android/app/src/main/res/raw
like image 23
Kalkidan Bekalu Avatar answered Jun 09 '26 06:06

Kalkidan Bekalu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!