Amar Sharma
Amar Sharma

Reputation: 1

React Native App will not launch - react native version mismatch and RCTView generated view config for validAttributes does not match native

My react native app will not launch. Between the time it launched and didn't launch, I made no major changes, only reloading the app.
I keep getting this error:

"React Native version mismatch"

Image of the version mismatch :
Image of the version mismatch

I have tried looking at posts of similar nature, however none of those solutions have helped.
Occasionally, as I was installing and uninstall various versions of react native to try to fix the app, I came across this error:

"RCTView generated view config for validAttributes does not match native, missingL accessibilityTraits"

Image of second error :
Image of second error

What I have tried:

  1. updating all packages that I am using for my project
  2. uninstalling and reinstalling react-native
  3. restarting terminal and computer

Here is my packages.json file:

{
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web",
    "eject": "expo eject"
  },
  "dependencies": {
    "1.3.0": "^1.3.0",
    "axios": "^0.19.0",
    "expo": "^34.0.4",
    "expo-web-browser": "^6.0.0",
    "react": "^16.10.1",
    "react-dom": "^16.8.6",
    "react-native": "^0.61.1",
    "react-native-elements": "^1.2.3",
    "react-native-gesture-handler": "^1.4.1",
    "react-native-popover-view": "^2.0.5",
    "react-native-reanimated": "^1.3.0",
    "react-navigation": "^4.0.10",
    "react-navigation-stack": "^1.9.3",
    "react-navigation-tabs": "^2.5.5"
  },
  "devDependencies": {
    "babel-preset-expo": "^6.0.0"
  },
  "private": true
}

I am using WebStorm as my IDE and testing on an iPhone 7 (physical). I have tried launching the app on other devices, it did not work.

Upvotes: 0

Views: 7786

Answers (3)

Lakshit Paliwal
Lakshit Paliwal

Reputation: 1

your version is miss matching in your package.json file, to overcome this problem use the following commands:-

if you are working with npm globally, then use:-

npm i -g npm-check-updates

then,

ncu -u && npm install

ncu -u shows you which version has updated to which version, screenshot of output of ncu -u

For a specific root folder/project use can use:-

npx npm-check-updates -u && npm i

then,

    ncu -u && npm install

Upvotes: 0

B.Asselin
B.Asselin

Reputation: 988

In your app.json, check expo.sdkVersion has the correct version.

Upvotes: 1

Rizwan Ahmed Shivalli
Rizwan Ahmed Shivalli

Reputation: 1503

try running this command in your project directory

watchman watch-del-all && rm -rf $TMPDIR/react-native-packager-cache-* && rm -rf $TMPDIR/metro-bundler-cache-* && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache

Upvotes: 2

Related Questions