Getting the following message when I init a new project and then launch the Xcode emulator:

React-Native Version Mismatch

Javascript Version 0.50.1 Native version: 0.50.0

Make sure you have rebuilt the native code. ...

Does anyone know what is going on here and can help me?


Solution 1:

This is what I've done with it:

Close all terminals and run build again.

You may forget to close nodejs terminal from another project, and they happen to have installed different react version.

So the code fetches from nodejs server conflicts with the native one.

Solution 2:

In case you created your react-native app using create-react-native-app. You should have a app.json (expo). and a package.json file, check if the expo versions match and change accordingly. For example in my case the problem was that in the app.json file I had a 25.0.0 version for the expo sdkVersion attribute, I change that to 23.0.0 and everything worked.

package.json:

"dependencies": {
    "expo": "^23.0.4",
    "react": "16.0.0",
    "react-native": "^0.50.4"
  }

app.json:

{
  "expo": {
    "sdkVersion": "23.0.0" // before was 25.0.0
  }
}

Solution 3:

Just go to your android/app/build.gradle and then add to the dependencies section:

dependencies{
compile ("com.facebook.react:react-native:0.50.3") { force = true } 
}

/// the react native version can be found in package.json

Solution 4:

For Android developers who couldn't get it fixed by just closing and rebuilding, Manually uninstall the app on the emulator/device.

Solution 5:

just force react native version in your android's app level gradle file, in the dependencies section.

compile ("com.facebook.react:react-native:0.52.0") { force = true }

worked for me