How do you track down version dependency issues?

145 Views Asked by At

I am trying to load my app in the simulator and continually get this error:

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

  This error is located at:
        in FastImageView (created by FastImageBase)
        in RCTView (created by View)
        in View (created by FastImageBase)
        in FastImageBase (created by FastImage)
        in FastImage (created by GenerateRandomSurvivor)
        in RCTView (created by View)
        in View (created by GenerateRandomSurvivor)
        in GenerateRandomSurvivor (created by App)
        in RCTView (created by View)
        in View (created by App)
        in App
        in RCTView (created by View)
        in View (created by AppContainer)
        in RCTView (created by View)
        in View (created by AppContainer)
        in AppContainer
        in DBDRandomizer(RootComponent), js engine: hermes

Using this package.json:

{
  "name": "DBDRandomizer",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "lint": "eslint .",
    "start": "react-native start",
    "start:dev": "ENVFILE=.env.dev react-native run-ios",
    "start:test": "ENVFILE=.env.test react-native run-ios",
    "start:prod": "ENVFILE=.env.prod react-native run-ios",
    "start-web": "npx react-native start --web",
    "test": "jest"
  },
  "dependencies": {
    "axios": "^1.6.1",
    "react": "^18.2.0",
    "react-native": "^0.73.2",
    "react-native-config": "^1.5.1",
    "react-native-dotenv": "^3.4.9",
    "react-native-fast-image": "^8.5.9"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0",
    "@babel/preset-env": "^7.20.0",
    "@babel/runtime": "^7.20.0",
    "metro-react-native-babel-preset": "^0.77.0",
    "@react-native/eslint-config": "^0.73.1",
    "@react-native/metro-config": "^0.73.3",
    "@react-native/typescript-config": "^0.73.1",
    "@types/react": "^17.0.2",
    "@types/react-test-renderer": "^18.0.0",
    "babel-jest": "^29.6.3",
    "babel-plugin-react-native-web": "^0.19.10",
    "eslint": "^8.19.0",
    "jest": "^29.6.3",
    "prettier": "2.8.8",
    "react-native-flipper": "^0.209.0",
    "react-test-renderer": "^18.2.0",
    "typescript": "5.0.4"
  },
  "engines": {
    "node": ">=20"
  }
}

I have tried the following:

  1. Xcode clean build cache
  2. yarn cache clean
  3. rm -rf node_modules
  4. rm -rf ~/Library/Developer/Xcode/DerivedData/*
  5. cd ios && pod install
  6. yarn react-native start --reset-cache

I also spent several hours trying different versions of react, react-native, react-native-fast-image, react-native-flipper, react-test-renderer and many more trying to find a working set of versions. While some led to other errors, none worked out. I eventually got it back to no warnings about mismatched versions. I would list the variations I tried, but I didn't have the foresight to write them down. Sorry.

This looks so much like a dependency issue, but I am having trouble tracking it down in this ecosystem. Is there a tool to find matching react versions I am unaware of? Can someone teach me to fish here? Am I off base here and it's something else?

2

There are 2 best solutions below

0
David Leavitt On

Here's what react-native-fast-image suggests:

  • Running Clean in Xcode.
  • Deleting Xcode's derived data.
  • Removing node_modules then reinstalling dependencies. rm -rf node_modules && yarn
  • Clearing watchman's watches. watchman watch-del-all
  • Clearing React Native's packager cache. react-native start --reset-cache
  • Clearing React Native's iOS build folder. rm -rf ios/build
  • Updating Pod repos. cd ios && pod repo update
  • Reinstalling Pods. cd ios && pod install

I know you tried several of them, but give them all a shot again. I would also try deleting the app from your device/simulator before you build, but after resetting all the caches and stuff. If those don't work, sorry. I am unaware of a tool for matching react versions and such. It's a good thought though, the package is almost two years old, it could be that it's just not compatible with your other packages.

0
Gennady Sabirovsky On

at first run cd ios && pod install

and also yarn start --reset-cache

re-build must be helpful for this.

there is a issue github.