react-native-vector-icons: [Xcode 11] 'Multiple commands produce' error when building with new Xcode build system
- 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
MacOS 10.14.6 RN 0.60.5 Latest RNVI Building on iOS
Description
Describe your issue in detail. Include screenshots if needed.
Reproducible Demo
https://github.com/facebook/react-native/issues/20492#issuecomment-533912772
On Xcode before upgrade 11, things work correctly and font assets copy without fatal error.
After Xcode 11 stable released and upgraded, it required fonts removal under [CP] Copy Pods Resources in Build Phases. Subsequent pod update brings them back, needing manual removal again.
Not sure if this is fixable only with special treatment on Xcode >= 11?
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 110
- Comments: 89
Links to this issue
Commits related to this issue
- Fixes build errors - one error was caused by react-native-vector-icons interacting poorly with the new autolinking feature. details: https://github.com/oblador/react-native-vector-icons/issues/1074#i... — committed to natalie-hunt/baesic by deleted user 5 years ago
- Removed duplicate font files in Copy Bundle Resources (https://github.com/oblador/react-native-vector-icons/issues/1074#issuecomment-534053163) — committed to suman-vanan/ssb-frontend by suman-vanan 3 years ago
- Install material kit and vector icons Those 2 additional step was needed for iOS to build 1. https://github.com/xinthink/react-native-material-kit/issues/437#issuecomment-696879816 2. https://github... — committed to torufuruya/crm by torufuruya 3 years ago
- [feat] vector-icons 패키지 재설치 - [vector-icons](https://github.com/oblador/react-native-vector-icons#ios) 패키지는 0.6 이상의 자동 설치는 따로 없어보인다 - Option: Manually를 참고하여 재설치 - ios 빌드할 때 'Multiple commands... — committed to goorea/MBTo by jhs851 3 years ago
- fix palette initilization for ios * Fix duplicate icons issue on ios build https://github.com/oblador/react-native-vector-icons/issues/1074#issuecomment-534053163 — committed to croma-app/huehive-mobile-app by kamalkishor1991 3 years ago
- React upgrade (#127) * replace code with new npx react-native init command * rename package name * add @react-navigation/native as a dependency * By following https://reactnavigation.org/docs/... — committed to croma-app/huehive-mobile-app by kamalkishor1991 2 years ago
Removing duplicate font files in
Copy Bundle Resourcesworked for me.The problem seems to be caused by the new autolinking feature in React Native 0.60 - the line
use_native_modules!inios/Podfilemeans when you dopod install, any pods found innode_modulesare automatically linked. This means that links to all font files are added to[CP] Copy Pods Resourceswhen you dopod install.If you previously installed
react-native-vector-iconsmanually by adding the font files toCopy Bundle Resources, you then get a “Multiple commands produce…” fatal build error.So to fix the problem, just remove the font files from
Copy Bundle Resources, so that they are only in[CP] Copy Pods Resources.Find a solution, simply remove duplicate reference fonts in “Copy Bundle Resources” NOT in “[CP] Copy Pods Resources”
For anyone else who didn’t know this,
Copy Bundle Resourcescan be found under theBuildPhases` tab in the target in your projectThanks. Everyone providing a solution but no one saying where it is 👍
Same here.
It looks like a bug or some new issue with new Xcode version.
Error response is:
Failed to build iOS project. We ran “xcodebuild” command but it exited with error code 65.
Detailed response:
Build system information error: Multiple commands produce ‘/path/of/the/project/ios/build/NameOfTheProject/Build/Products/Debug-iphonesimulator/NameOfTheProject.app/Zocial.ttf’:
1) Target ‘NameOfTheProject’ (project ‘NameOfTheProject’) has copy command from ‘/path/of/the/project/NameOfTheProject/node_modules/react-native-vector-icons/Fonts/Zocial.ttf’ to ‘/path/of/the/project/NameOfTheProject/ios/build/NameOfTheProject/Build/Products/Debug-iphonesimulator/NameOfTheProject.app/Zocial.ttf’
2) That command depends on command in Target ‘NameOfTheProject’ (project ‘NameOfTheProject’): script phase “[CP] Copy Pods Resources”
Build system information error: Multiple commands produce ‘/path/of/the/project/ios/build/NameOfTheProject/Build/Products/Debug-iphonesimulator/NameOfTheProject.app/SimpleLineIcons.ttf’:
1) Target ‘NameOfTheProject’ (project ‘NameOfTheProject’) has copy command from ‘/path/of/the/project/NameOfTheProject/node_modules/react-native-vector-icons/Fonts/SimpleLineIcons.ttf’ to ‘/path/of/the/project/NameOfTheProject/ios/build/NameOfTheProject/Build/Products/Debug-iphonesimulator/NameOfTheProject.app/SimpleLineIcons.ttf’
2) That command depends on command in Target ‘NameOfTheProject’ (project ‘NameOfTheProject’): script phase “[CP] Copy Pods Resources”
…
That response repeat for each .ttf file used by the library.
I had to temporary
react-native unlink react-native-vector-icons, and the project build again, but with not icons.for me, the safest and easiest way was:
npx react-native unlink react-native-vector-iconsnpm uninstall react-native-vector-iconsnpx pod-installnpm install react-native-vector-iconsnpx pod-installnpx react-native run-iosthat’s it!
Tested on the following versions of packages:
I’ve made this steps and project are building again:
react-native-vector-icons:Open project in the Xcode and click in the left side on your project name:
Go to the
Build Phaseslike the following:You’ll see the
Copy Bundle Resourceslike the following:Note: Remove all font icons from the list, in the case of image icons was been removed.
I hope this step by step helps you. ✨
Fixed it by removing fonts in the Copy Bundle Resource
@ulises-jimenez the real mvp
Very simple solution … after pod install , run
npx react-native unlink react-native-vector-iconthen paste the following in info.plist
thank you so much @KandarpAjvalia
if I remove the fonts from the
Copy Bundle Sourcefile the build succeed but it gives me another errorunrecognised Font family 'MarlinGeo-Black'. There are my Error.Here I have my ScreenShots .
if I remove these from here then the error show in the first screenshot I got. and if I add there lines then the second one.
can anyone explain this.
Solved problem, thank so much.
File -> Workspace Settings -> Legacy Build System
add this to your podfile
Only remove fonts from build phases that are part of RNVI, if you are adding your own fonts you will need these under Copy Bundle Resource.
Hi jackli, I tried it but it created a new problem 😦
Solution at https://user-images.githubusercontent.com/3395492/46074144-0ac18300-c187-11e8-973b-4d08251fcb18.png worked for me.
same here with 0.61.0-rc.3 and xcode 11 11A420a mojave 10.14.6
@RnbWd Incase you haven’t found your workaround yet, my approach to avoid having to remove it after every pod install was the following:
yarn add react-native-vector iconsnode_modules/react-native-vector-icons/Fontsand copy the fonts you wish to use.src/assets/icons)react-native-config.jsnode_modules/react-native-vector-icons/react-native-config.jsto the followingnode_modules/react-native-vector-icons/RNVectorIcons.podspec, remove thes.resources = "Fonts/*.ttf"line entirely.npx patch-package react-native-vector-icons.cd ios && pod install && cd ..npx react-native link"postinstall": "npx patch-package"to the scripts inpackage.jsonso the patch is automatically applied after every install.saved the day
It’d be nice not to have to manually remove this every time I run pod install.
Following this video finally got my fonts to show up. I was getting red question mark for a few hours and duplicate error message. Hope this helps someone out.
https://www.youtube.com/watch?v=5Rc0ujISKUo
It work perfectly!
@kindacoder see if same fonts exist, because if you install two packages that have fonts there’s a chance there will be duplicates. I had installed react-native-vector-icons and native-base, both had fonts and there were duplicates in the bundle resources and that was causing this error. Here’s where I found the solution
Whyyyyyyyyyy is this still a thing 😦((((((((((((((((
@fungilation, i am pretty sure that this issue is very much still alive. let me know if i am missing something. i just wasted almost 90 minutes trying to figure out why this was happening in my app after upgrading some tooling. it would be unfortunately if this kept happening to more folks.
it seems like the crux of the problem is that the font files are being referred to by both the
react-native.config.jsand thepodspec.the reference to the font files as assets in the
react-native.config.jswill cause thereact-native linkto load the fonts as a resource for the App project.while the reference to the font files as resources in the
RNVectorIcons.podspecwill causepod installto load the fonts as resources for the Podfile project.i suspect that the solution is to update either
react-native.config.jsorpodspecto that the fonts are not double counted.Real problem with module.
Fixed it by removing fonts in the Xcode - Build Phases/[CP] Copy Bundle Resource
@awgeorge We’re in the same situation, what worked for us was to just choose the legacy build system in xcode 11.1.
Is there anyway to disable this feature? We’re still on .59 and the linking happens in our build process. We don’t have our workspace committed, the pipeline literally does a pod install and react native link every time. Now our builds fail as its duplicating these fonts.
removing icon files from Copy Bundle Resources worked for me
oh my god! Why this bug still exist ? 2021 is coming soon. This shit bug waste three hours of my time.
To build on @carlost strategy, for me it was the podspec. Adding this to the scripts section on package.json fixed it for me.
"postinstall": "sed -i '' '/s.resources/d' ./node_modules/react-native-vector-icons/RNVectorIcons.podspec"Would be nice if the following was in the README.md telling users to remove the font files rather than adding them if they are using autolinking (the default on the latest react native).
I didn’t have to remove the icon files manually. The easiest solution is to create a file in the root of the project:
react-native.config.js, and add the following content;You might have to rerun
yarn installand also install pods again.UPDATE: Not sure what fixed it but it works now
Nothing working for me. Anyone have any ideas? All the fonts added in my Info.plist with no duplicates: .
Removing them from the Copy Bundle Resources solves the multiple commands produce error but that gives me and Unrecognized font family error:
.
Removing them from the Copy Bundle Resources solves the multiple commands produce error but that gives me and Unrecognized font family error:

I also tried @goff-studio’s workaround of unlinking, uninstalling and reinstalling the package and @mpeguese’s video (creating a Fonts folder in the project folder) with the same results as above,
My app builds fine but its the deploys using Fastlane that are having issues
Remove all .ttf files that belongs to
react-native-vector-iconsfromCopy Bundle Resourcesunder theBuild Phasesin Xcode works for me.For us, we had font entries in Copy bundle resources as well as copy pods resource. Fonts were also in the info.list file. Removing from pods resources worked for us.
pod installnpx react-native run-iosso to follow up on my earlier post … i have a post install hook in my package.json that patches the
react-native.config.jsfile inreact-native-vector-iconsto remove theassets: ['Fonts']config. that resolves this issue.Be sure to have unchecked the “Target Membership”
Is there any way to avoid having manually go into XCode and remove the fonts from the Copy Bundle Resource tap when launching a new project using react-native-vector-icons and custom fonts with RN 0.6+ (autolink feature)?
you all were on xcode while i was looking on vscode xD
React Native Link [that I’m working on 0.64 version, so basically, Linked automatically after installation.
Hi! I’m wondering why this issue is closed. It is certainly not resolved, since autolinking when you do
pod installwith react-native-vector-icons still breaks at least iOS release builds. This still happens with the newest versions of React Native and this package.Thank you! I lost a day trying to add these icons D: