React-native-vector-icons: Error: Multiple commands produce in Xcode 10

Created on 25 Sep 2018  路  17Comments  路  Source: oblador/react-native-vector-icons

Environment

React Native Environment Info:
System:
OS: macOS 10.14
CPU: x64 Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz
Memory: 162.83 MB / 8.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 8.11.4 - /usr/local/bin/node
npm: 5.6.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.0, macOS 10.14, tvOS 12.0, watchOS 5.0
Android SDK:
Build Tools: 23.0.1, 25.0.0, 25.0.3, 26.0.2, 26.0.3, 27.0.0, 27.0.3
API Levels: 19, 22, 23, 24, 25, 26, 27
IDEs:
Android Studio: 3.1 AI-173.4720617
Xcode: 10.0/10A255 - /usr/bin/xcodebuild
npmPackages:
react: 16.4.1 => 16.4.1
react-native: 0.56.0 => 0.56.0
npmGlobalPackages:
create-react-native-app: 1.0.0
react-native-cli: 2.0.1
react-native-git-upgrade: 0.2.7
react-native-rename: 2.2.2

Description

My React Native App's build failed after installing the Xcode 10. When I look the debug logs. I saw

error: Multiple commands produce '/Users/salih/Desktop/Github/Kopgitv1/ios/build/Build/Products/Debug-iphonesimulator/Kopgitv1.app/Entypo.ttf':
1) Target 'Kopgitv1' (project 'Kopgitv1') has copy command from '/Users/salih/Desktop/Github/Kopgitv1/node_modules/native-base/Fonts/Entypo.ttf' to '/Users/salih/Desktop/Github/Kopgitv1/ios/build/Build/Products/Debug-iphonesimulator/Kopgitv1.app/Entypo.ttf'
2) Target 'Kopgitv1' (project 'Kopgitv1') has copy command from '/Users/salih/Desktop/Github/Kopgitv1/node_modules/react-native-vector-icons/Fonts/Entypo.ttf' to '/Users/salih/Desktop/Github/Kopgitv1/ios/build/Build/Products/Debug-iphonesimulator/Kopgitv1.app/Entypo.ttf'

Problem come from native-base and react-native-vector-icons packages.

Reproducible Demo

Use react-native-vector-icons in your project.
Try to get build from iOS 12 in Xcode 10 with
react-native run-ios

Most helpful comment

Thank you for using the template, most people misses the point of them 馃檪

I also had some troubles upgrading to Xcode 10 (there's always something wrong with this IDE...) but not this library (I don't use native-base though). I tried reproducing but nothing went wrong until installing and linking native-base as well, this indeed causes react-native-vector-icons to be linked twice but pretty sure it is a bug with react-native or Xcode.

This might fix it:
meh

All 17 comments

Thank you for using the template, most people misses the point of them 馃檪

I also had some troubles upgrading to Xcode 10 (there's always something wrong with this IDE...) but not this library (I don't use native-base though). I tried reproducing but nothing went wrong until installing and linking native-base as well, this indeed causes react-native-vector-icons to be linked twice but pretty sure it is a bug with react-native or Xcode.

This might fix it:
meh

Thanks.

@cyb3rsalih @hampustagerud I had the same problem because native-base uses react-native-vector-icons. To only use native base by default for icons performs the following steps:

react-native unlink react-native-vector-icons
npm uninstall react-native-vector-icons
npm install native-base
react-native link

The solution provided by @hampustagerud is only temporary since every time you make react-native link the icons will be duplicated again.
You can use react-native-vector-icons through native-base in this way:

import { Icon } from 'native-base';

<Icon type="FontAwesome" name="home" />

And what about if we are using native-base but also need utilities other than Icon from react-native-vector-icons? I'm using createIconSetFromIcoMoon to I can have custom vector icons. This method doesn't seem to be exposed by native-base.

Hello, in my case to solved the problem, not run the link command (react-native link), only install the dependency (npm install react-native-vector-icons --save) and use customs icons (import { createIconSetFromIcoMoon } from 'react-native-vector-icons';) Regards!!

@kaitlynbrown you can import react-native-vector-icons from node_modules because native-base installs react-native-vector-icons but not appears in your package.json.

Example:

import { createIconSetFromIcoMoon } from '../node_modules/react-native-vector-icons';

@Juliocbr But if I want to preload icons with _Icon.getImageSource()_ how do I specify the font type? I mean FontAwesome, IonicIcons, etc..

Changing my build system to 'Legacy Build System' solved my issue.
Go to XCode -> File -> Project Settings -> Change the build system to 'Legacy Build System'

thanks you so much

In my case I had to remove some _libRN...a_ files, like libRNDeviceInfo.a and libRNGestureHandler.a from Build Phases -> Link Binary with Libraries since they were already being referenced from another libraries:
Screen Shot 2019-04-17 at 10 50 49 PM

My issue was that I had two references GoogleService-Info.plist in the project / file view. The correct location is in the project root.

Thank you for using the template, most people misses the point of them 馃檪

I also had some troubles upgrading to Xcode 10 (there's always something wrong with this IDE...) but not this library (I don't use native-base though). I tried reproducing but nothing went wrong until installing and linking native-base as well, this indeed causes react-native-vector-icons to be linked twice but pretty sure it is a bug with react-native or Xcode.

This might fix it:
meh

Thanks so much! you saved my day!

I have the same issue for Xcode 11. Tried reinstalling/linking the library but the issue remains. Made sure I have no duplicates - and I even tried removing the files alltogether from "Copy Bundle Resources" - but then I get the issue of the files not existing instead. Any ideas? :)

@robertherber There is a related issue in the react-native repo and have a solution in recent comment: 'Multiple commands produce' error when building with new Xcode build system.

@robertherber There is a related issue in the react-native repo and have a solution in recent comment: 'Multiple commands produce' error when building with new Xcode build system.

Thanks, this time it worked for me to completely remove the fonts from the "bundle resources" and trust CocoaPods to do the magic. But I'm pretty sure I did the same before and ended up with missing the fonts - so I'm not sure it's fully deterministic! :)

@robertherber There is a related issue in the react-native repo and have a solution in recent comment: 'Multiple commands produce' error when building with new Xcode build system.

Thanks, this time it worked for me to completely remove the fonts from the "bundle resources" and trust CocoaPods to do the magic. But I'm pretty sure I did the same before and ended up with missing the fonts - so I'm not sure it's fully deterministic! :)

This solved my problem. It turned out that Fonts were in Resources folder even after deleting them from Copy Bundle Resources

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tharrington picture tharrington  路  4Comments

emretekince picture emretekince  路  4Comments

semnyqu picture semnyqu  路  3Comments

jakewtaylor picture jakewtaylor  路  4Comments

AbhayVarshney picture AbhayVarshney  路  3Comments