[solved] Duplicate resources android build error with v9.1.0 - [fonts were in source tree *and* using module's build.gradle font copy]
See original GitHub issue- Review the documentation: https://github.com/oblador/react-native-vector-icons
- Search for existing issues (including closed issues): https://github.com/oblador/react-native-vector-icons/issues
Environment
react-native 0.67.2, gradle 7.4, android gradle plugin 7.1.1, react-native-vector-icons 9.1.0 (hot off the presses!)
Description
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeDevDebugAssets'.
> [fonts/Fontisto.ttf] /Users/mike/work/EquityResidences/equityresidences/packages/public-app/android/app/src/main/assets/fonts/Fontisto.ttf [fonts/Fontisto.ttf] /Users/mike/work/EquityResidences/equityresidences/packages/public-app/android/app/build/intermediates/ReactNativeVectorIcons/fonts/Fontisto.ttf: Error: Duplicate resources
[fonts/Octicons.ttf] /Users/mike/work/EquityResidences/equityresidences/packages/public-app/android/app/src/main/assets/fonts/Octicons.ttf [fonts/Octicons.ttf] /Users/mike/work/EquityResidences/equityresidences/packages/public-app/android/app/build/intermediates/ReactNativeVectorIcons/fonts/Octicons.ttf: Error: Duplicate resources
[fonts/Feather.ttf] /Users/mike/work/EquityResidences/equityresidences/packages/public-app/android/app/src/main/assets/fonts/Feather.ttf [fonts/Feather.ttf] /Users/mike/work/EquityResidences/equityresidences/packages/public-app/android/app/build/intermediates/ReactNativeVectorIcons/fonts/Feather.ttf: Error: Duplicate resources
[fonts/Entypo.ttf] /Users/mike/work/EquityResidences/equityresidences/packages/public-app/android/app/src/main/assets/fonts/Entypo.ttf [fonts/Entypo.ttf] /Users/mike/work/EquityResidences/equityresidences/packages/public-app/android/app/build/intermediates/ReactNativeVectorIcons/fonts/Entypo.ttf: Error: Duplicate resources
[fonts/FontAwesome5_Brands.ttf] /Users/mike/work/EquityResidences/equityresidences/packages/public-app/android/app/src/main/assets/fonts/FontAwesome5_Brands.ttf [fonts/FontAwesome5_Brands.ttf] /Users/mike/work/EquityResidences/equityresidences/packages/public-app/android/app/build/intermediates/ReactNativeVectorIcons/fonts/FontAwesome5_Brands.ttf: Error: Duplicate resources
[fonts/MaterialCommunityIcons.ttf] /Users/mike/work/EquityResidences/equityresidences/packages/public-app/android/app/src/main/assets/fonts/MaterialCommunityIcons.ttf [fonts/MaterialCommunityIcons.ttf] /Users/mike/work/EquityResidences/equityresidences/packages/public-app/android/app/build/intermediates/ReactNativeVectorIcons/fonts/MaterialCommunityIcons.ttf: Error: Duplicate resources
[fonts/AntDesign.ttf] /Users/mike/work/EquityResidences/equityresidences/packages/public-app/android/app/src/main/assets/fonts/AntDesign.ttf [fonts/AntDesign.ttf] /Users/mike/work/EquityResidences/equityresidences/packages/public-app/android/app/build/intermediates/ReactNativeVectorIcons/fonts/AntDesign.ttf: Error: Duplicate resources
[fonts/Foundation.ttf] /Users/mike/work/EquityResidences/equityresidences/packages/public-app/android/app/src/main/assets/fonts/Foundation.ttf [fonts/Foundation.ttf] /Users/mike/work/EquityResidences/equityresidences/packages/public-app/android/app/build/intermediates/ReactNativeVectorIcons/fonts/Foundation.ttf: Error: Duplicate resources
[fonts/Ionicons.ttf] /Users/mike/work/EquityResidences/equityresidences/packages/public-app/android/app/src/main/assets/fonts/Ionicons.ttf [fonts/Ionicons.ttf] /Users/mike/work/EquityResidences/equityresidences/packages/public-app/android/app/build/intermediates/ReactNativeVectorIcons/fonts/Ionicons.ttf: Error: Duplicate resources
[fonts/FontAwesome5_Solid.ttf] /Users/mike/work/EquityResidences/equityresidences/packages/public-app/android/app/src/main/assets/fonts/FontAwesome5_Solid.ttf [fonts/FontAwesome5_Solid.ttf] /Users/mike/work/EquityResidences/equityresidences/packages/public-app/android/app/build/intermediates/ReactNativeVectorIcons/fonts/FontAwesome5_Solid.ttf: Error: Duplicate resources
[fonts/FontAwesome5_Regular.ttf] /Users/mike/work/EquityResidences/equityresidences/packages/public-app/android/app/src/main/assets/fonts/FontAwesome5_Regular.ttf [fonts/FontAwesome5_Regular.ttf] /Users/mike/work/EquityResidences/equityresidences/packages/public-app/android/app/build/intermediates/ReactNativeVectorIcons/fonts/FontAwesome5_Regular.ttf: Error: Duplicate resources
[fonts/FontAwesome.ttf] /Users/mike/work/EquityResidences/equityresidences/packages/public-app/android/app/src/main/assets/fonts/FontAwesome.ttf [fonts/FontAwesome.ttf] /Users/mike/work/EquityResidences/equityresidences/packages/public-app/android/app/build/intermediates/ReactNativeVectorIcons/fonts/FontAwesome.ttf: Error: Duplicate resources
[fonts/Zocial.ttf] /Users/mike/work/EquityResidences/equityresidences/packages/public-app/android/app/src/main/assets/fonts/Zocial.ttf [fonts/Zocial.ttf] /Users/mike/work/EquityResidences/equityresidences/packages/public-app/android/app/build/intermediates/ReactNativeVectorIcons/fonts/Zocial.ttf: Error: Duplicate resources
[fonts/EvilIcons.ttf] /Users/mike/work/EquityResidences/equityresidences/packages/public-app/android/app/src/main/assets/fonts/EvilIcons.ttf [fonts/EvilIcons.ttf] /Users/mike/work/EquityResidences/equityresidences/packages/public-app/android/app/build/intermediates/ReactNativeVectorIcons/fonts/EvilIcons.ttf: Error: Duplicate resources
[fonts/SimpleLineIcons.ttf] /Users/mike/work/EquityResidences/equityresidences/packages/public-app/android/app/src/main/assets/fonts/SimpleLineIcons.ttf [fonts/SimpleLineIcons.ttf] /Users/mike/work/EquityResidences/equityresidences/packages/public-app/android/app/build/intermediates/ReactNativeVectorIcons/fonts/SimpleLineIcons.ttf: Error: Duplicate resources
[fonts/MaterialIcons.ttf] /Users/mike/work/EquityResidences/equityresidences/packages/public-app/android/app/src/main/assets/fonts/MaterialIcons.ttf [fonts/MaterialIcons.ttf] /Users/mike/work/EquityResidences/equityresidences/packages/public-app/android/app/build/intermediates/ReactNativeVectorIcons/fonts/MaterialIcons.ttf: Error: Duplicate resources
Reproducible Demo
I’m still investigating this but thought to log it quickly since rolling back to 9.0.0 does not cause a build faliure, while 9.1.0 does. I can confirm with 9.0.0 I actually do have vector icons showing up as well so by all appearances 9.0.0 is working
Likely cause #1401 but I haven’t looked into it thoroughly yet
I tried rm -fr android/build android/app/build
and rebuilt, just to see if that had an effect. No effect. Only the revert to v9 is successful at the moment
I am not including specific fonts, the tail of my android/app/build.gradle
is:
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
Issue Analytics
- State:
- Created 2 years ago
- Reactions:5
- Comments:37 (16 by maintainers)
Top Results From Across the Web
React Native : Error: Duplicate resources - Android
In my case, the build failed because there are duplicated resources in my Android project (in Android folder), these two lines are necessary ......
Read more >Duplicate Resources Error In Android Studio - Fixed - YouTube
Coding Moody goes Off when you frequently encounter some errors !We CodingTony channel here we are to help you fix some common android...
Read more >Bug listing with status RESOLVED with resolution TEST ...
configure isn't using config options" status:RESOLVED ... Bug:87516 - "Duplicate resources on Korganizer, Kontact, etc make all tasks appear twice" ...
Read more >Package List — Spack 0.20.0.dev0 documentation
This is a list of things you can install using Spack. ... Versions: 1.0.1, 1.0; Build Dependencies: cmake, ninja, boost, mpi; Link Dependencies:...
Read more >Nixpkgs 22.11 manual - NixOS
Nix expressions describe how to build packages from source and are collected ... of licenses can be found in the file lib/licenses.nix of...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yeah, I’m pretty confident this is the case. You should pick one approach, either manually copying them to your fonts folder, or copying on build with gradle. To fix this error simply remove the duplicates in
packages/public-app/android/app/src/main/assets/fonts
, they are most likely out of date anyways.Same problem in v9.1.0, removing them will work again:
android/app/src/main/fonts/AntDesign.ttf
android/app/src/main/fonts/MaterialCommunityIcons.ttf
Update
Check your
android/app/src/main/fonts
directory, if the following files exist, just delete them:AntDesign.ttf
Entypo.ttf
EvilIcons.ttf
Feather.ttf
FontAwesome.ttf
FontAwesome5_Brands.ttf
FontAwesome5_Regular.ttf
FontAwesome5_Solid.ttf
Fontisto.ttf
Foundation.ttf
Ionicons.ttf
MaterialCommunityIcons.ttf
MaterialIcons.ttf
Octicons.ttf
SimpleLineIcons.ttf
Zocial.ttf