3

I am trying to use native base icons in my app but every time i am getting Unrecognized font family ‘Ionicons’ error. I searched it on google and tried everything. like rm -rf node_modules && npm install react-native link react-native-vector-icons react-native start --reset-cache

can anybody tell me some basic setups like where should I create my resource folder and all for this fix? Thanks

enter image description here

Pankaj Agrawal
  • 1,469
  • 2
  • 17
  • 27
  • Are you using create-react-native-app? I just added native-base to my crna project and saw this error. – mchandleraz Jun 25 '17 at 03:06
  • 2
    yes. I fixed this issue by adding the file in my BuildPhase > copy bundle resource section – Pankaj Agrawal Jun 26 '17 at 16:40
  • For React Native **0.60+** see my comment here https://stackoverflow.com/questions/38713240/unrecognized-font-family-ionicons/58133303#58133303 – Eddy Sep 27 '19 at 11:08

3 Answers3

5

I think you have to create folder call "Resources" in your Xcode project and place Ionicons.ttf file inside that folder. Try setup iOS Manually here (https://github.com/oblador/react-native-vector-icons)

  • Browse to node_modules/react-native-vector-icons and drag the folder Fonts (or just the ones you want) to your project in Xcode. Make sure your app is checked under "Add to targets" and that "Create groups" is checked if you add the whole folder.
  • Edit Info.plist and add a property called Fonts provided by application.enter image description here
Dinith Minura
  • 1,446
  • 2
  • 12
  • 24
1

for anyone facing similar issue while using the following combination

"native-base": "^2.8.1", "react": "16.6.1", "react-native": "0.57.7", "react-native-gesture-handler": "^1.0.10", "react-native-vector-icons": "^6.1.0", "react-navigation": "^3.0.8",

first clean the node_modules folder, then reinstall and also link

rm -rf node_modules
npm i
react-native link

then from xcode clean and then build for the ios project and run it in the simulator from xcode itself.

Rishabh
  • 3,752
  • 4
  • 47
  • 74
-1

I faced same issue. Following steps helped me out:

  1. Install react-native-vector-icons npm
  2. Install pod

And you are good to go.

Kushal Desai
  • 119
  • 2
  • 11