1

Everything was working fine before, but not icons are showing up as boxes with an X through them, and I get this error:

fontFamily "FontAwesome" 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.

package.json

"dependencies": {
"@expo/ngrok": "^2.4.3",
"@expo/vector-icons": "^12.0.3",
"@react-native-community/cli": "^4.14.0",
"@react-native-community/datetimepicker": "^3.0.9",
"@react-native-community/masked-view": "^0.1.10",
"@react-navigation/bottom-tabs": "^5.11.3",
"expo": "^40.0.1",
"expo-cli": "4.2.1",
"expo-font": "^9.0.0",
"expo-status-bar": "~1.0.3",
"firebase": "^8.2.9",
"moment": "^2.29.1",
"ngrok": "^3.4.0",
"npm": "^7.5.4",
"react": "16.13.1",
"react-dom": "16.13.1",
"react-native": "0.63.4",
"react-native-check-box": "^2.1.7",
"react-native-elements": "^3.1.0",
"react-native-gesture-handler": "^1.10.0",
"react-native-paper": "^4.7.1",
"react-native-reanimated": "^1.13.2",
"react-native-safe-area-context": "^3.1.9",
"react-native-screens": "^2.17.1",
"react-native-unimodules": "^0.12.0",
"react-native-vector-icons": "^8.1.0",
"react-native-web": "~0.13.12",
"react-navigation": "^4.4.3",
"react-navigation-stack": "^2.10.2",
"react-navigation-tabs": "^2.10.1"
},

Please help! This error is driving me crazy!

  • how do you use the FontAwesome? If I'm not mistaken FontAwesome has npm package but I don't see it anywhere in your package.json – jted95 Mar 05 '21 at 02:23
  • @garjted I just import it like `import { FontAwesome5 } from '@expo/vector-icons';` and then I put the icon in like ``. The icons worked before and I never had to download font awesome into package.json. – Daniel Sarmiento Mar 07 '21 at 20:10

1 Answers1

0

I think you should just remove the FontAwesome5 from the Font.loadAsync since it is not a fontFamily. FontAwesome5 is a package used to render icons from your App and not a font style.

KKK
  • 507
  • 3
  • 12
  • I don't think that is the issue because it is not just with FontAwesome5. I am having issues with all the icons. Whether is MaterialCommunityIcons or any other icon, it does not load anymore. The icons are in the `android/app/src/assets` folder. The icons were working fine before, but when I updated, it made me download `expo-font` dependency. – Daniel Sarmiento Mar 09 '21 at 13:37
  • That's weird. Are you using FontAwesome5 as a fontFamily style of your Text? Because that error will only show when you are using downloaded font (font asset) in your project. – KKK Mar 10 '21 at 03:40
  • Yeah I know its so confusing. I am importing the icons like this: `import { FontAwesome5 } from '@expo/vector-icons';` and then using them like this: ``. I don't understand why it isn't working anymore. – Daniel Sarmiento Mar 10 '21 at 15:27