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?
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:
After removing these 2 files, i then run:
cd android
./gradlew assembleRelease
Then it shows me build successful :)
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With