Closed geeekgod closed 11 months ago
Was able to fix it by adding the fonts name in Info.plist
, as suggested in the following issue.
Although not sure why such behaviour occurred, this should have been done by its own I believe.
I was having the same issue, and after days looking for the problem, for some reason the font-family name are different.
Open node modules -> react-native-vector-icons -> your react native project first. Fonts, open the [project] folder in your iOS folder. Right-click xcworkspace now and choose Create Group. Rename the group to Fonts.
drag the .ttf fonts you need from your node_modules folder and drop just below your Fonts Group.
Expand the Group with the same name as your react native project and click on info.plist, click on the + beside Information Property List in the Key section then replace Get info string with Fonts provided by application, type the font details beside item [number] exactly as it is in your Fonts Group.
After this, run shift + command + K to clean your previous build, then command + B to run a new build and finally command + R to start your application.
This would solve the issue else restart your metro bundler.
follow the below link for solution https://www.devhubspot.net/post/detail/react-native-unrecognised-font-family-error-solution
Environment
0.71.7
^9.2.0
Description
I'm trying to use
react-native-vector-icons
in my project along with the UI librarynative-base
. I have followed and configured all the steps according to documentation, the icons are visible and working as expected in Android builds. But in the iOS build icons are not visible and instead it throws the following error:Unrecognized font family 'Material Icons'
. I've tried everything which was feasible and related to giving the following problem such as clearing cache, rebuilding, manually linking, and manually building through Xcode as well.Here's the screenshot of the error that I'm receiving,
I can guess it is due to the fonts not being loaded into the iOS builds, but as per
react-native
auto-linking &react-native-vector-icons
documentation it should have been done, though I tried to copy resource all the fonts into the build through Xcode as well, but nothing seems to work.Reproducible Demo
I'm adding the code snippet where
react-native-vector-icons
is throwing the error.Welcome.jsx
:package.json
: