Unrecognized Font Family on React Native

前端 未结 5 1296
春和景丽
春和景丽 2021-02-11 01:57

I\'m running into a peculiar error using React Native. Inside my button.js I am doing

import Icon from \"react-native-vector-icons/MaterialIcons\";         


        
5条回答
  •  梦如初夏
    2021-02-11 02:37

    If you have completed all the above steps and still get the same error, you need to Clean your iOS project from Xcode then Build it. This will completely reset the project and ensure that the .ttf file is included.

    Run your project from within Xcode and it should now work.

    You may still find your project still doesn't work using react-native run-ios. If this is the case, open Finder and navigate to the ios folder in your project and delete the entire build folder. Then close your simulator and package manager terminal, and run react-native run-ios again. This will take a couple of minutes as it's rebuilding everything, but then (hopefully) your app will run correctly.

提交回复
热议问题