Closed fungilation closed 4 years ago
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.
Tested on the following versions of packages:
- react-native: 0.62.2;
- react-native-vector-icons: 6.6.0;
I've made this steps and project are building again:
- Add
react-native-vector-icons
:$ yarn add react-native-vector-icons
- Link resources to project:
cd <your-project>; react-native link; cd <your-project>/ios; pod install;
- Open project in the Xcode and click in the left side on your project name:
![]()
- Go to the
Build Phases
like the following:![]()
- You'll see the
Copy Bundle Resources
like the following:![]()
Note: Remove all font icons from the list, in the case of image icons was been removed.
- Run your project again to re-install with this update:
$ react-native run-ios
I hope this step by step helps you. ✨
Solved problem, thank so much.
Is there a better solution?
Yes there is a better solution.. I fixed this issue by creating a new blank template with react-native-cli, and then delete the iOS / android folders, replacing them with the template, and using vscode to help modify the important files in the android / iOS folders. I also do all of my font linking manually instead of running react-native link
Find a solution, simply remove duplicate reference fonts in "Copy Bundle Resources" NOT in "[CP] Copy Pods Resources"
This works for me! thanks.
https://github.com/oblador/react-native-vector-icons/issues/1074#issuecomment-616335309
It works once pod install, but not for the first time.
I'm still using the patch for patch-package as other people here did mention before and its working well, also on CI:
File: react-native-vector-icons+8.1.0.patch
diff --git a/node_modules/react-native-vector-icons/RNVectorIcons.podspec b/node_modules/react-native-vector-icons/RNVectorIcons.podspec
index 4b716ee..08f6378 100644
--- a/node_modules/react-native-vector-icons/RNVectorIcons.podspec
+++ b/node_modules/react-native-vector-icons/RNVectorIcons.podspec
@@ -12,7 +12,6 @@ Pod::Spec.new do |s|
s.platforms = { :ios => "9.0", :tvos => "9.0" }
s.source = { :git => "https://github.com/oblador/react-native-vector-icons.git", :tag => "v#{s.version}" }
s.source_files = 'RNVectorIconsManager/**/*.{h,m}'
- s.resources = "Fonts/*.ttf"
s.preserve_paths = "**/*.js"
s.dependency 'React-Core'
Remove all .ttf files that belongs to react-native-vector-icons
from Copy Bundle Resources
under the Build Phases
in Xcode works for me.
@bpouzet solution <3
@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
saved the day
if I remove the fonts from the Copy Bundle Source
file the build succeed but it gives me another error unrecognised Font family 'MarlinGeo-Black'
. There are my Error.
<img width="1280" alt="Screenshot 2021-07-01 at 10 40 00 AM" src="https://user-images.githubusercontent.com/78194973/124072516-45545a80-da5a-11eb-85b2-24002b9714c1.png">
Multiple commands produce '/Users/umairhassan/Library/Developer/Xcode/DerivedData/truecaller-altzuyoazoqmqdeceflrhwqheodc/Build/Products/Debug-iphonesimulator/truecaller.app/L-Bold.ttf':
1) Target 'truecaller' (project 'truecaller') has copy command from '/Users/umairhassan/repos/CallerApp/src/assets/fonts/L-Bold.ttf' to '/Users/umairhassan/Library/Developer/Xcode/DerivedData/truecaller-altzuyoazoqmqdeceflrhwqheodc/Build/Products/Debug-iphonesimulator/truecaller.app/L-Bold.ttf'
2) That command depends on command in Target 'truecaller' (project 'truecaller'): script phase “[CP] Copy Pods Resources”
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.
Can someone explain why removing the fonts from Copy Bundle Resources is the solution when the documentation for RNVI explicitly tells you to have them there?
Per the RNVI docs: "Note: you need to recompile your project after adding new fonts, also ensure that they also appear under Copy Bundle Resources in Build Phases."
Removing them from Copy Bundle Resources finally allowed my app to build however, and the icons are still present.
for me, the safest and easiest way was:
npx react-native unlink react-native-vector-icons
npm uninstall react-native-vector-icons
npx pod-install
npm install react-native-vector-icons
npx pod-install
npx react-native run-ios
that's it!
Below solution worked for me after 2 hrs of struggle
for me, the safest and easiest way was:
npx react-native unlink react-native-vector-icons
npm uninstall react-native-vector-icons
npx pod-install
npm install react-native-vector-icons
npx pod-install
npx react-native run-ios
![]()
that's it!
which method did you use for the ios installation (https://github.com/oblador/react-native-vector-icons#ios) ... the cocoa pods one? I'm still getting a Unrecognized font family Material Design Icons
error when running npx react-native run-ios
command
for me, the safest and easiest way was:
npx react-native unlink react-native-vector-icons
npm uninstall react-native-vector-icons
npx pod-install
npm install react-native-vector-icons
npx pod-install
npx react-native run-ios
![]()
that's it!
which method did you use for the ios installation (https://github.com/oblador/react-native-vector-icons#ios) ... the cocoa pods one? I'm still getting a
Unrecognized font family Material Design Icons
error when runningnpx react-native run-ios
command
React Native Link [that I'm working on 0.64 version, so basically, Linked automatically after installation.
For those want to know the reason behind it.
When React has already auto linked vector icons and you do manual link there comes duplicate resources. Cheers.
Whyyyyyyyyyy is this still a thing :(((((((((((((((((
I had to uncheck "For Install builds only" on [CP] Copy Pods Resources for it to work for me. I also manually added the font names into the "Fonts provided by application" section in the info.plist and removed the font files from Copy Bundle Resources but not sure if that was required.
Hopefully this helps someone.
My fault was not editing my "info.plist"
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/nodemodules/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/nodemodules/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.
You save my life :( Many thanks
Find a solution, simply remove duplicate reference fonts in "Copy Bundle Resources" NOT in "[CP] Copy Pods Resources"
perfect !
For anyone else who didn't know this,
Copy Bundle Resources
can be found under theBuild
Phases` tab in the target in your project
Thank you. You saved my day Man!!
Any option to remove those files from copy bundle resources dynamically (using command line) OR how to avoid adding those files
for me, the safest and easiest way was:
npx react-native unlink react-native-vector-icons
npm uninstall react-native-vector-icons
npx pod-install
npm install react-native-vector-icons
npx pod-install
npx react-native run-ios
![]()
that's it!
It work perfectly!
Does anyone know how to fix this problem with AppCenter?
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
Find a solution, simply remove duplicate reference fonts in "Copy Bundle Resources" NOT in "[CP] Copy Pods Resources" remove all ocurrence of the duplicate tff files
you all were on xcode while i was looking on vscode xD
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:
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
removing icon files from Copy Bundle Resources worked for me
removing icon files from Copy Bundle Resources worked for me
this worked for me
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;
module.exports = {
dependencies: {
'react-native-vector-icons': {
platforms: {
ios: null,
},
},
},
};
You might have to rerun yarn install
and also install pods again.
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).
So to fix the problem, just remove the font files from
Copy Bundle Resources
, so that they are only in[CP] Copy Pods Resources
.
For me, I deleted Fonts
folder inside project and it works
I listed the fonts in Info.plist
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;module.exports = { dependencies: { 'react-native-vector-icons': { platforms: { ios: null, }, }, }, };
You might have to rerun
yarn install
and also install pods again.
It's 2024, and this is the best answer here. Thanks for sharing!
By Mistake I've deleted copy bundle resources now after build I'm getting black screen how do I fix this ?
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. Subsequentpod update
brings them back, needing manual removal again.Not sure if this is fixable only with special treatment on Xcode >= 11?