React-native-vector-icons: Get error Unrecognized font family 'icomoon'

Created on 21 Nov 2017  路  4Comments  路  Source: oblador/react-native-vector-icons

Hi!
I try to use custom icon font with icomoon, but I get the error Unrecognized font family 'icomoon'
in my component:

import { createIconSetFromIcoMoon } from 'react-native-vector-icons';
import IcoMoonConfig from '../../assets/svg/selection.json';
const IconCustom = createIconSetFromIcoMoon(IcoMoonConfig);

<IconCustom name="Resilience" style={{fontSize:10}}/>

in my package.json

"rnpm": {
        "assets": [
            "./App/assets/fonts",
            "resources/fonts"
        ]
    }

Also I added ttf file to xcode
2017-11-21 10 15 19
Thanks for any help.

Most helpful comment

I getting same error and solved today. I see you already added Copy Bundle Resources link. You need to follow this steps:
1- Your custom tff file must be added on "Fonts provided by application" under the info.plist file. You can control this on xcode
2- Then run this commands
- rnpm link react-native-vector-icons
- rm -rf ios/build
- react-native run-ios

All 4 comments

I getting same error and solved today. I see you already added Copy Bundle Resources link. You need to follow this steps:
1- Your custom tff file must be added on "Fonts provided by application" under the info.plist file. You can control this on xcode
2- Then run this commands
- rnpm link react-native-vector-icons
- rm -rf ios/build
- react-native run-ios

Don't bother and switch to fontello imo

Thanks for the instructions/help @mriza1815. I'm going to close this one as it's already in the readme. If you believe it can be improved I'm open to suggestions in a PR 馃樃

After installation you need to link the library (After the updation of React Native 0.60, they have introduced autolinking feature means we do not require to link the library but they have also mentioned that some libraries need linking and react-native-vector-icons is one of those cases).
After the linking just install the ios/pod file using pod install

You can follow Example to Use Vector Icons in React Native for the updated example of React Native 0.60

Was this page helpful?
0 / 5 - 0 ratings