Categories
Mastering Development

family font ionicons is not a system font expo error

I used the latest sdk expo and published my app. It worked fine on andorid and ios but only the icons didn’t show. They showed as question mark on ios. I made an empty project and downgraged to expo 36.0.0 and published it on ios and it worked fine, the icons showed but when use downgrade expo in my actual project it gives me this error.

fontFamily “ionicons” is not a system font and has not been loaded through Font.loadAsync.

  • If you intended to use a system font, make sure you typed the name correctly and that it is supported by your device operating system.

  • If this is a custom font, be sure to load it with Font.loadAsync.

DEPENDCIES

"expo": "^36.0.0",
"expo-font": "^8.1.1",
"native-base": "^2.13.8",

LOAD SCREEN

setTimeout(async () => {
this.props.navigation.navigate('Main')
            await Font.loadAsync({
                Roboto: require('native-base/Fonts/Roboto.ttf'),
                Roboto_medium: require('native-base/Fonts/Roboto_medium.ttf'),
                ...Ionicons.font,
            });
        }, 2000)
        this.setState({ isReady: true });
}

MAIN SCREEN

import { Button, Icon } from 'native-base'
<Icon name="copy" style= />
//This line casues the error. If i remove it, the error won't show.

Leave a Reply

Your email address will not be published. Required fields are marked *