NativeBase icon indicating copy to clipboard operation
NativeBase copied to clipboard

Unrecognized font family 'Ionicons'

Open charlieroth opened this issue 10 years ago • 50 comments

Here I have a simple component:

import React, { Component } from 'react';
import {
  Container,
  Header,
  Title,
  Content,
  Button,
  Icon,
} from 'native-base';

export default class App extends Component {
  render() {
    return(
      <Container>
        <Header>
          <Button transparent>
              <Icon name="ios-arrow-back" />
          </Button>

          <Title>Header</Title>

          <Button transparent>
              <Icon name="ios-menu" />
          </Button>
        </Header>

        <Content>

        </Content>
      </Container>
    );
  }
}

I ran rnpm link like I was told to do in the Getting Started section of the docs. I am getting this error: screen shot 2016-07-21 at 11 43 59 am

Any suggestions? Should I try to link native-base manually following the instructions in the docs?

charlieroth avatar Jul 21 '16 15:07 charlieroth

Same problems... also checked xcode. The fonts are already in the build phase

advany avatar Jul 22 '16 00:07 advany

You have restart packager after adding fonts. Close the packager terminal and restart from xcode. Should fix your problem.

sankhadeeproy007 avatar Jul 22 '16 05:07 sankhadeeproy007

Try rnpm link react-native-vector-icons

olivergeorge avatar Jul 23 '16 11:07 olivergeorge

/node_modules/native-base/node_modules/react-native-vector-icons/RNVectorIconsManager/RNVectorIconsManager.h:9:9: 'RCTBridgeModule.h' file not found

kumarryogeshh avatar Sep 03 '16 22:09 kumarryogeshh

Try running rm -rf node_modules && npm install If RN < 0.29, run rnpm link react-native-vector-icons If RN >= 0.29, run react-native link react-native-vector-icons

himanshu-satija avatar Sep 06 '16 11:09 himanshu-satija

Same problem here even after following the above suggestions.

Update:

I was able to resolve the issue by editing the info.plist, adding the font files, then running the application with Xcode. Docs here: https://github.com/oblador/react-native-vector-icons

RobbyRob81 avatar Oct 02 '16 19:10 RobbyRob81

I solved and I think this is one of cause. http://image.prntscr.com/image/837ddc4fea2d427e8466671c2515b3b1.png I tried to re-run this command react-native link react-native-vector-icons because my RN >= 0.29.

tranquang7979 avatar Dec 31 '16 02:12 tranquang7979

react-native link react-native-vector-icons solved my problem.

clucasalcantara avatar Jan 19 '17 12:01 clucasalcantara

Only declaring in Info.plist helped http://stackoverflow.com/a/30540901

farruxx avatar Jan 30 '17 18:01 farruxx

Hi All, I was having same problem and resolved by doing this.

  1. close running packager
  2. run react-native link react-native-vector-icons
  3. and run react-native start --reset-cache
  4. Finally use react-native run-ios

sravindravmd avatar Feb 05 '17 12:02 sravindravmd

@sravindravmd thank you so much.

zhulinpinyu avatar Mar 01 '17 17:03 zhulinpinyu

@charlieroth You can try to recreate the iOS Scheme on XCode, and run react-native link or rnpm link after.

clucasalcantara avatar Mar 02 '17 17:03 clucasalcantara

What worked for me was uninstalling the @expo/vector-icons package recommended by Native-base Getting Started guide, and installing the react-native-vector-icons as a dependency.

npm install react-native-vector-icons --save
react-native link react-native-vector-icons

nicnilov avatar Apr 03 '17 15:04 nicnilov

react-native link react-native-vector-icons is working for me thanks.

Lalit-Joshi avatar Apr 12 '17 10:04 Lalit-Joshi

Hi, I am getting this same issue. So for some reason, my app is working perfectly fine when I run it through the emulator. But when I run it on my device, the same error is shown. I have no clue why it works on the emulator but not on the device.

AbhayVarshney avatar Apr 28 '17 01:04 AbhayVarshney

@AbhayVarshney If you are using expo/CRNA then you need to import then Ionicons . somewhat like

  async componentWillMount() {
      await Expo.Font.loadAsync({
        'Roboto': require('native-base/Fonts/Roboto.ttf'),
        'Roboto_medium': require('native-base/Fonts/Roboto_medium.ttf'),
        'Ionicons': require('native-base/Fonts/Ionicons.ttf'),
      });
  }

you can have a look here this will work for you .

geekrishabh avatar Apr 28 '17 04:04 geekrishabh

@GeekRishabh I haven't used expo for my project. Is there another method w/o expo?

AbhayVarshney avatar Apr 28 '17 06:04 AbhayVarshney

I had the same issue.

Solved by running first Link

react-native link

Then restart,

react-native run-ios

kadharmfn avatar May 23 '17 03:05 kadharmfn

I specifically want to use Entypo from react-native-vector-icons. I have copied over the Fonts folder to the Xcode, checked all the icon types are there in info.plist and copy bundle resources, rm -rf node_modules && npm install, clean up last build, react-native link react-native-vector-icons and then npm start but it still does not work.

import Entypo from 'react-native-vector-icons/Entypo';

<Entypo name={icon} size={25}/>

and nothing shows up (Iconwise..) :(

ckim16 avatar Jun 06 '17 23:06 ckim16

I faced the issue with both v2.1.4 and v2.1.5 So I fixed the version in package.json to "native-base": "2.1.3" Then ran the following: rm -rf node_modules npm i react-native link

wung-s avatar Jun 16 '17 05:06 wung-s