react-native-paper icons error on Android using Expo

Viewed 496

I'm using Expo and react-native-paper. In the react-native-paper docs it says: "If you use Expo, you don't need to install vector icons"

The icons work on the web version in Expo, but not on Android (emulator or through the app).

On Android I get this error: Unable to resolve "react-native-vector-icons/MaterialCommunityIcons" from "node_modules\react-native-paper\src\components\MaterialCommunityIcon.tsx"

Tried the solutions below (even though I think I'm not supposed to use these when using Expo)

  • If I install the react-native-vector-icons package, I get the error: fontFamily "MaterialCommunityIcons" is not a system font and has not been loaded through Font.loadAsync

  • Trying solutions in here: Running react-native link react-native-vector-icons doesn't seem to help. Can't access Android Gradle when using Expo.

Package versions:

    "@expo/vector-icons": "^12.0.0",
    "expo": "~40.0.0",
    "expo-file-system": "~9.3.0",
    "expo-font": "~8.4.0",
    "expo-status-bar": "~1.0.3",
    "react": "16.13.1",
    "react-dom": "16.13.1",
    "react-hook-form": "^6.13.0",
    "react-native": "https://github.com/expo/react-native/archive/sdk-40.0.0.tar.gz",
    "react-native-paper": "^4.4.1",
0 Answers
Related