Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error with Expo fontFamily "material-community" is not a system font and has not been loaded through Font.loadAsync

I upgraded to expo 34.0.3 and related dependencies as below

"dependencies": {
    "@expo/samples": "3.0.3",
    "@expo/vector-icons": "^10.0.3",
    "add": "^2.0.6",
    "expo": "^34.0.3",
    "expo-asset": "^5.0.1",
    "expo-font": "~6.0.1",
    "moment": "^2.24.0",
    "react": "16.8.3",
    "react-native": "https://github.com/expo/react-native/archive/sdk-34.0.0.tar.gz",
    "react-native-gesture-handler": "^1.3.0",
    "react-native-modal": "^11.3.1",
    "react-native-modal-datetime-picker": "^7.5.0",
    "react-native-snackbar-component": "^1.1.0",
    "react-navigation": "^3.11.1",
    "react-redux": "^7.1.0",
    "redux": "^4.0.4",
    "redux-persist": "^5.10.0"
  },

My App.js is presumably correctly preloading the fonts like so

  import * as Font from 'expo-font';
  import * as Icon from '@expo/vector-icons';

   .........


  _loadResourcesAsync = async () => {
    return Promise.all([
      Font.loadAsync({
        ...Icon.Ionicons.font,
        ...Icon.MaterialCommunityIcons.font,
      }),
    ]);
  };

Now just to be clear, this code was working just fine before the expo upgrade. This issue is seen on both Android and iOS devices.

console error

like image 395
rnk Avatar asked Dec 07 '22 11:12

rnk


1 Answers

I have fixed the issue by using the following command in terminal

rm -rf ./node_modules/expo/node_modules/expo-font/

like image 188
IKKA Avatar answered Dec 11 '22 08:12

IKKA