'Task :app:mergeReleaseStagingAssets FAILED Duplicate Resources

I am trying to build for android and submit to play store, but i am getting the attached error

Running the command ./gradlew clean && ./gradlew bundleRelease.

Task :app:mergeReleaseStagingAssets FAILED AGPBI: {"kind":"error","text":"Duplicate resources","sources":[{"file":{"description":"fonts/Fontisto.ttf","path":"/Users/matt/Desktop/volosports/mobile4/android/app/src/main/assets/fonts/Fontisto.ttf"}},{"file":{"description":"fonts/Fontisto.ttf","path":"/Users/matt/Desktop/volosports/mobile4/android/app/build/intermediates/ReactNativeVectorIcons/fonts/Fontisto.ttf"}}],"tool":"Resource and asset merger"} AGPBI: {"kind":"error","text":"Duplicate resources","sources":[{"file":{"description":"fonts/Octicons.ttf","path":"/Users/matt/Desktop/volosports/mobile4/android/app/src/main/assets/fonts/Octicons.ttf"}},{"file":{"description":"fonts/Octicons.ttf","path":"/Users/matt/Desktop/volosports/mobile4/android/app/build/intermediates/ReactNativeVectorIcons/fonts/Octicons.ttf"}}],"tool":"Resource and asset merger"} AGPBI: {"kind":"error","text":"Duplicate resources","sources":[{"file":{"description":"fonts/Feather.ttf","path":"/Users/matt/Desktop/volosports/mobile4/android/app/src/main/assets/fonts/Feather.ttf"}},{"file":{"description":"fonts/Feather.ttf","path":"/Users/matt/Desktop/volosports/mobile4/android/app/build/intermediates/ReactNativeVectorIcons/fonts/Feather.ttf"}}],"tool":"Resource and asset merger"} AGPBI: {"kind":"error","text":"Duplicate resources","sources":[{"file":{"description":"fonts/Entypo.ttf","path":"/Users/matt/Desktop/volosports/mobile4/android/app/src/main/assets/fonts/Entypo.ttf"}},{"file":{"description":"fonts/Entypo.ttf","path":"/Users/matt/Desktop/volosports/mobile4/android/app/build/intermediates/ReactNativeVectorIcons/fonts/Entypo.ttf"}}],"tool":"Resource and asset merger"} AGPBI: {"kind":"error","text":"Duplicate resources","sources":[{"file":{"description":"fonts/FontAwesome5_Brands.ttf","path":"/Users/matt/Desktop/volosports/mobile4/android/app/src/main/assets/fonts/FontAwesome5_Brands.ttf"}},{"file":{"description":"fonts/FontAwesome5_Brands.ttf","path":"/Users/matt/Desktop/volosports/mobile4/android/app/build/intermediates/ReactNativeVectorIcons/fonts/FontAwesome5_Brands.ttf"}}],"tool":"Resource and asset merger"} AGPBI: {"kind":"error","text":"Duplicate resources","sources":[{"file":{"description":"fonts/MaterialCommunityIcons.ttf","path":"/Users/matt/Desktop/volosports/mobile4/android/app/src/main/assets/fonts/MaterialCommunityIcons.ttf"}},{"file":{"description":"fonts/MaterialCommunityIcons.ttf","path":"/Users/matt/Desktop/volosports/mobile4/android/app/build/intermediates/ReactNativeVectorIcons/fonts/MaterialCommunityIcons.ttf"}}],"tool":"Resource and asset merger"} AGPBI: {"kind":"error","text":"Duplicate resources","sources":[{"file":{"description":"fonts/AntDesign.ttf","path":"/Users/matt/Desktop/volosports/mobile4/android/app/src/main/assets/fonts/AntDesign.ttf"}},{"file":{"description":"fonts/AntDesign.ttf","path":"/Users/matt/Desktop/volosports/mobile4/android/app/build/intermediates/ReactNativeVectorIcons/fonts/AntDesign.ttf"}}],"tool":"Resource and asset merger"} AGPBI: {"kind":"error","text":"Duplicate resources","sources":[{"file":{"description":"fonts/Foundation.ttf","path":"/Users/matt/Desktop/volosports/mobile4/android/app/src/main/assets/fonts/Foundation.ttf"}},{"file":{"description":"fonts/Foundation.ttf","path":"/Users/matt/Desktop/volosports/mobile4/android/app/build/intermediates/ReactNativeVectorIcons/fonts/Foundation.ttf"}}],"tool":"Resource and asset merger"} AGPBI: {"kind":"error","text":"Duplicate resources","sources":[{"file":{"description":"fonts/Ionicons.ttf","path":"/Users/matt/Desktop/volosports/mobile4/android/app/src/main/assets/fonts/Ionicons.ttf"}},{"file":{"description":"fonts/Ionicons.ttf","path":"/Users/matt/Desktop/volosports/mobile4/android/app/build/intermediates/ReactNativeVectorIcons/fonts/Ionicons.ttf"}}],"tool":"Resource and asset merger"} AGPBI: {"kind":"error","text":"Duplicate resources","sources":[{"file":{"description":"fonts/FontAwesome5_Solid.ttf","path":"/Users/matt/Desktop/volosports/mobile4/android/app/src/main/assets/fonts/FontAwesome5_Solid.ttf"}},{"file":{"description":"fonts/FontAwesome5_Solid.ttf","path":"/Users/matt/Desktop/volosports/mobile4/android/app/build/intermediates/ReactNativeVectorIcons/fonts/FontAwesome5_Solid.ttf"}}],"tool":"Resource and asset merger"} AGPBI: {"kind":"error","text":"Duplicate resources","sources":[{"file":{"description":"fonts/FontAwesome5_Regular.ttf","path":"/Users/matt/Desktop/volosports/mobile4/android/app/src/main/assets/fonts/FontAwesome5_Regular.ttf"}},{"file":{"description":"fonts/FontAwesome5_Regular.ttf","path":"/Users/matt/Desktop/volosports/mobile4/android/app/build/intermediates/ReactNativeVectorIcons/fonts/FontAwesome5_Regular.ttf"}}],"tool":"Resource and asset merger"} AGPBI: {"kind":"error","text":"Duplicate resources","sources":[{"file":{"description":"fonts/FontAwesome.ttf","path":"/Users/matt/Desktop/volosports/mobile4/android/app/src/main/assets/fonts/FontAwesome.ttf"}},{"file":{"description":"fonts/FontAwesome.ttf","path":"/Users/matt/Desktop/volosports/mobile4/android/app/build/intermediates/ReactNativeVectorIcons/fonts/FontAwesome.ttf"}}],"tool":"Resource and asset merger"} AGPBI: {"kind":"error","text":"Duplicate resources","sources":[{"file":{"description":"fonts/Zocial.ttf","path":"/Users/matt/Desktop/volosports/mobile4/android/app/src/main/assets/fonts/Zocial.ttf"}},{"file":{"description":"fonts/Zocial.ttf","path":"/Users/matt/Desktop/volosports/mobile4/android/app/build/intermediates/ReactNativeVectorIcons/fonts/Zocial.ttf"}}],"tool":"Resource and asset merger"} AGPBI: {"kind":"error","text":"Duplicate resources","sources":[{"file":{"description":"fonts/EvilIcons.ttf","path":"/Users/matt/Desktop/volosports/mobile4/android/app/src/main/assets/fonts/EvilIcons.ttf"}},{"file":{"description":"fonts/EvilIcons.ttf","path":"/Users/matt/Desktop/volosports/mobile4/android/app/build/intermediates/ReactNativeVectorIcons/fonts/EvilIcons.ttf"}}],"tool":"Resource and asset merger"} AGPBI: {"kind":"error","text":"Duplicate resources","sources":[{"file":{"description":"fonts/SimpleLineIcons.ttf","path":"/Users/matt/Desktop/volosports/mobile4/android/app/src/main/assets/fonts/SimpleLineIcons.ttf"}},{"file":{"description":"fonts/SimpleLineIcons.ttf","path":"/Users/matt/Desktop/volosports/mobile4/android/app/build/intermediates/ReactNativeVectorIcons/fonts/SimpleLineIcons.ttf"}}],"tool":"Resource and asset merger"} AGPBI: {"kind":"error","text":"Duplicate resources","sources":[{"file":{"description":"fonts/MaterialIcons.ttf","path":"/Users/matt/Desktop/volosports/mobile4/android/app/src/main/assets/fonts/MaterialIcons.ttf"}},{"file":{"description":"fonts/MaterialIcons.ttf","path":"/Users/matt/Desktop/volosports/mobile4/android/app/build/intermediates/ReactNativeVectorIcons/fonts/MaterialIcons.ttf"}}],"tool":"Resource and asset merger"}

I have deleted the duplicate files but it seems to be getting made each time i run the build command.

Anyone know this issue as to why this is happening?



Solution 1:[1]

I am working on react native.

For me, this issue caused because of react-native link Command

This command created multiple duplicate files.

Solution 1 (If your project is in git)

Delete the project and clone the project. (Try to avoid the commands which will create duplicate files )

Solution 2

Find out the duplicate files and delete them.

This thing works for me.

I'll try to come back with a better solution.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1