Invariant Violation: requireNativeComponent: "FastImageView" was not found in the UIManager in react native
Asked Answered
D

6

11

When I'm writting this code error is showing please let me know, Where i'm worng?

import React, { Component } from 'react'; import { StyleSheet, Text, View, TouchableOpacity, FlatList, Modal, } from 'react-native';

import FastImage from 'react-native-fast-image'

const Imagegallery = () => (
    <FastImage
        style={{ width: 200, height: 200 }}
        source={{
            uri: 'https://unsplash.it/400/400?image=1',
            priority: FastImage.priority.normal,
        }}
        resizeMode={FastImage.resizeMode.contain}
    />
)

export default Imagegallery
Depersonalize answered 18/11, 2019 at 5:57 Comment(0)
I
14

After installing react-native-fast-image you have to run pod command in you ios directory.

So run this command :

cd ios
pod install

Then run your project.

Inapproachable answered 18/11, 2019 at 9:43 Comment(3)
I'm using expo in windowsDepersonalize
fast-image does not support on expo. You have to find alternate solution for this.Inapproachable
quite late for this, but now it is supported in expo, just run npm install --save [email protected] or if you are using yarn yarn add [email protected]Indurate
C
5

It's late but for those who got this error, I think It's better to use RN 60.0 because of the auto-linking feature since they didn't provide manual installation for RN < 60.0.

if you're using RN > 60.0 just paste this to your terminal

yarn add react-native-fast-image

and then rebuild the app

react-native run-android

It should now work.

Cravat answered 25/12, 2019 at 13:11 Comment(0)
E
2

You can try either

  • Delete node_modules
  • Run npm install

OR

Add these lines and manually link the library

Settings.gradle

include ':react-native-fast-image'
project(':react-native-fast-image').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fast-image/android')

MainApplication.java

import com.dylanvann.fastimage.FastImageViewPackage;

Podfile

pod 'RNFastImage', :path => '../node_modules/react-native-fast-image'
Eradicate answered 2/5, 2021 at 5:41 Comment(0)
W
2

It happens on snack:

https://snack.expo.dev/@johndimm/react-native-fast-image-test

It also fails on my local machine with these dependencies:

    "expo": "~44.0.0",
    "expo-status-bar": "~1.2.0",
    "react": "17.0.1",
    "react-dom": "17.0.1",
    "react-native": "0.64.3",
    "react-native-fast-image": "^8.5.11",
    "react-native-web": "0.17.1"

Invariant Violation: requireNativeComponent: "FastImageView" was not found in the UIManager.

Witness answered 16/2, 2022 at 23:19 Comment(0)
E
0

I am using react-native 0.59.9, which works properly on android with react-native-fast-image 7.0.0.

On iOS you need react-native-fast-image 6.1.1, and in order to prevent the error described in the question, I had to do manual installation (https://github.com/DylanVann/react-native-fast-image/blob/4fa62bb09f65d967977f25ef87eda5f8b7c18cd6/docs/installation-manual.md#ios)

Epistrophe answered 17/5, 2020 at 17:56 Comment(0)
O
0

For Android:

Check existence of /build dir in node_modules/react-native-fast-imaage/android

In my case 'FastImageView was not found...' error was occurring when build dir was absent in android dir because of issue in build.gradle. Correcting the issue of gradle successfully generated build dir and the error was gone.

Opalopalesce answered 20/1, 2024 at 15:39 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.