React-native-vector-icons: Unrecognized font family 'Ionicons'

Created on 27 Apr 2020  Â·  3Comments  Â·  Source: oblador/react-native-vector-icons

Project develop environment package.json file:
"react": "16.11.0",
"react-native": "0.62.2",
"react-native-vector-icons": "^6.6.0",

Class import:
import Icon from 'react-native-vector-icons/Ionicons';

IDE:
Xcode11.2.1
VSCode 1.44.2

Debug iOS in VSCode
Log:Unrecognized font family 'Ionicons'
image

Most helpful comment

Just go to _ios/YourAppName/Info.plist_ and add:
``xml (...) <dict> <key>UIAppFonts</key> <array> <string>Ionicons.ttf</string> </array> (...) </dict>

All 3 comments

I got that issue with exactly the same configuration as you.
Loading it manually worked for me.
"react-native-vector-icons": "6.6.0",
"react-native": "0.62.2",
"react": "16.11.0",

import Ionicons from 'react-native-vector-icons/Ionicons'

export default () => {

    const [loaded, setLoaded] = useState(false);

    useEffect(() => {
        (async () => {
            await Ionicons.loadFont();
            setLoaded(true);
        })();
    }, []);

    return loaded && <App />
}

Just go to _ios/YourAppName/Info.plist_ and add:
``xml (...) <dict> <key>UIAppFonts</key> <array> <string>Ionicons.ttf</string> </array> (...) </dict>

SOLUTION
This is how you fix the error. Don't go mental like I did for 30 minutes. Simply resolve the issue by editing the info.plist, adding the font files like it says in docs here: https://github.com/oblador/react-native-vector-icons
Search for plist and add the Key and Array of all the strings.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tharrington picture tharrington  Â·  4Comments

lossen picture lossen  Â·  4Comments

mahdidavoodi7 picture mahdidavoodi7  Â·  3Comments

reactor123 picture reactor123  Â·  3Comments

rmilejcz picture rmilejcz  Â·  3Comments