Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Error: Multiple commands produce in Xcode 10 #851

Closed
cyb3rsalih opened this issue Sep 25, 2018 · 17 comments
Closed

Error: Multiple commands produce in Xcode 10 #851

cyb3rsalih opened this issue Sep 25, 2018 · 17 comments

Comments

@cyb3rsalih
Copy link

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

@hampustagerud
Copy link
Collaborator

hampustagerud commented Sep 26, 2018

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

@cyb3rsalih
Copy link
Author

Thanks.

@Juliocbr
Copy link

Juliocbr commented Sep 27, 2018

@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" />

@kaitlynbrown
Copy link

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.

@kuez
Copy link

kuez commented Oct 6, 2018

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!!

@Juliocbr
Copy link

Juliocbr commented Oct 7, 2018

@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';

@Cicko
Copy link

Cicko commented Jan 9, 2019

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

@Chandrasekar-G
Copy link

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'

@Domingowen
Copy link

thanks you so much

@samarti
Copy link

samarti commented Apr 18, 2019

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

@mfbx9da4
Copy link

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

@aerda
Copy link

aerda commented Aug 13, 2019

I solve it, with this: facebook/react-native#20492 (comment)

@chj-damon
Copy link

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!

@robertherber
Copy link

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? :)

@kmsbernard
Copy link

kmsbernard commented Sep 23, 2019

@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
Copy link

@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! :)

@josipbernat
Copy link

@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

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests