react-native: React Native version mismatch. JavaScirpt version:0.49.3 ,Native version:0.50.3

Is this a bug report?

(write your answer here)

Have you read the Contributing Guidelines?

(Write your answer here.)

Environment

Steps to Reproduce

(Write your steps here:)

Expected Behavior

(Write what you thought would happen.)

Actual Behavior

(Write what happened. Add screenshots!)

Reproducible Demo

(Paste the link to an example project and exact instructions to reproduce the issue.)

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 1
  • Comments: 23 (2 by maintainers)

Most upvoted comments

You probably forgot to close your React Packager (terminal) which is running with a different version of react native. Try to close it and restart your app again

Update : If it still doesn’t work, you can force React Native version in android/app/build.gradle file like this: compile ("com.facebook.react:react-native:0.52.0") { force = true }. Change 0.52.0 to the version you’re using, found in package.json. (from this answer)

The mismatch means that the version of your JS and your native code don’t match. Closing this since this isn’t a bug with React Native. Please post if you have a suggestion for how to communicate this more clearly, the fundamental problem is that the JS doesn’t work with the native code though so there’s no way we can make this magically work.

  1. Kill metro bundler by killall node
  2. Uninstall the app from emulator
  3. react-native run-android or react-native run-ios

I am still getting this error in android, after trying all the above solution

React Native version mismatch. JavaScript version: 0.50.4 Native version: 0.55.3

##While in cmd

react-native -version react-native-cli: 2.0.1 react-native: 0.50.4

I have restarted my command prompt, visual studio and finally my system too.

Update : The solution of Wiltzu ( https://github.com/facebook/react-native/issues/19259 ) helped me to solve my problem.

open terminal inside your project folder step1- sudo npm install -g react-native-git-upgrade step2- react-native-git-upgrade after this delete the two highlighted lines in manifest.xml for the conflict named ‘>>>then and >>>>after’ step3- watch-del-all && react-native start --reset-cache now run your command react-native run-android

i resolved by using:

react-native start --reset-cache

For others with the same problem on iOS with CocoaPods:

Like ide hinted above, the React version specified in my Podfile didn’t match the JS version. React was specified in my Podfile (I needed this for a package with native dependencies), but the React pod didn’t automatically get upgraded by using react-native-git-upgrade.

The fix is to upgrade the installed pods yourself, by running cd ios && pod install.

@harikrishnanp thank bro uninstall app in emulator, solved

@harikrishnanp thank you broooh 😃 👍 💯 🥇

I try all you said, it’s not working. It only happen in android real device. Can anyone help?

@harikrishnanp Thanks man! Uninstalling the app was what did it for me!

react-native upgrade solved the issue for me.

@oleksandr-yefremov I am in Windows and commented out mavenLocal, still no luck.

Note that I have an ejected EXPO project and I still get this error. How can I get rid of 0.49, in favor of 0.50.3 that I am using in package.json?

Thanks!

UPDATE: The problem was with code-push updating the JS. Now it is OK (I bumbed the native versions and previous code-push versions do not apply to them)