'Error while using FastImage with my react native app

while integrating FastImage with my react native app I am getting the below error:-

enter image description here

Code:-

import FastImage from "react-native-fast-image";
const qmeLogoURL = require('../../assets/splash-screen/logo.png');
 <FastImage
            style={styles.image}
            source={Logo}
        />

package.json

  "dependencies": {
    "@expo/vector-icons": "^10.2.0",
    "@react-navigation/native": "^5.7.1",
    "axios": "^0.19.2",
    "expo": "~38.0.1",
    "expo-av": "~8.2.1",
    "expo-barcode-scanner": "~8.2.0",
    "expo-file-system": "^9.0.1",
    "expo-splash-screen": "^0.3.1",
    "expo-updates": "~0.2.10",
    "expo-video-player": "^1.5.8",
    "prop-types": "^15.7.2",
    "react": "~16.11.0",
    "react-dom": "~16.11.0",
    "react-native": "~0.62.2",
    "react-native-camera": "^3.33.0",
    "react-native-elements": "^2.0.2",
    "react-native-fast-image": "^8.3.2",
    "react-native-gesture-handler": "~1.6.0",
    "react-native-keyboard-aware-scroll-view": "^0.9.1",
    "react-native-permissions": "^2.1.5",
    "react-native-web": "~0.11.7",
    "react-redux": "^7.2.0",
    "redux": "^4.0.5",
    "redux-devtools-extension": "^2.13.8",
    "redux-thunk": "^2.3.0",
    "rxjs": "^6.6.0"
  },

Can anyone please tell me what am I doing wrong?



Solution 1:[1]

First of all, I saw in your package.json that you are using expo and if you are using expo managed workflow you can't use this module, if it is a bare workflow then you can, have a look at this.

https://github.com/DylanVann/react-native-fast-image/issues/704

This error occurs when you don't link your native module with your project so since auto-linking is been introduced in 0.60.0 version of react-native so it should be auto-linked so after installing a native module (react-native-fast-image) you must have to re-install the app again.

if you are on IOS do this.

cd ios
pod install

and install the app again.

if you are on android simply rebuild your project and install the app again

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1