0

This is a snippet of my code:

export default class HomeScreen extends React.Component {
  state = {
    fontLoaded: false,
  };

  async componentDidMount() {
    await Font.loadAsync({
      'Ubuntu-Regular': require('../assets/fonts/Ubuntu-Regular.ttf'),
      'Ubuntu-Bold': require('../assets/fonts/Ubuntu-Bold.ttf'),
    });

    this.setState({ fontLoaded: true });
  }

  render() {
  ...

Yet I continue to get the error "fontFamily "ubuntu-bold" is not a system font and has not been loaded through Font.loadAsync."

What could be the problem? I'm really stumped on this one. I have just upgraded to Expo SDK 37.0.0, however I was having a similar problem prior to doing this, so I'm not sure that's the problem.

It also doesn't load in Ubuntu Regular, but it's Ubuntu-Bold that flashes up first with an error on Expo.

allybee_chan
  • 25
  • 1
  • 5

1 Answers1

0

watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && rm -f package-lock.json && rm -f yarn.lock && npm cache verify && npm install && expo r -c

try this

  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Dec 27 '21 at 23:30