react-native-vector-icons: Error: Multiple commands produce in Xcode 10
Environment
React Native Environment Info: System: OS: macOS 10.14 CPU: x64 Intel® Core™ 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
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 17
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-baseas well, this indeed causes react-native-vector-icons to be linked twice but pretty sure it is a bug withreact-nativeor Xcode.This might fix it:
@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:
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:
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’
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? 😃
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! 😃
@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:
@robertherber There is a related issue in the
react-nativerepo and have a solution in recent comment: ‘Multiple commands produce’ error when building with new Xcode build system.And what about if we are using native-base but also need utilities other than
Iconfromreact-native-vector-icons? I’m usingcreateIconSetFromIcoMoonto I can have custom vector icons. This method doesn’t seem to be exposed by native-base.This solved my problem. It turned out that Fonts were in Resources folder even after deleting them from Copy Bundle Resources
I solve it, with this: https://github.com/facebook/react-native/issues/20492#issuecomment-521002479