We've been working on this React Native app for a fair amount of time. It was working fine even a few hours ago and it suddenly started to give this error. None of the usual solutions (reset cache, reboot terminal and machine) are working.

Environment:
OS: macOS Sierra 10.12.6
Node: 8.11.1
Yarn: 1.5.1
npm: 5.6.0
Watchman: Not Found
Xcode: Xcode 9.2 Build version 9C40b
Android Studio: 3.0 AI-171.4443003
Packages: (wanted => installed)
react: 16.2.0 => 16.2.0
react-native: 0.52.0 => 0.52.0
react-native init App --version 0.52.0
react-native run-android
App should work
App doesn't work
Thanks for posting this! It looks like your issue may refer to an older version of React Native. Can you reproduce the issue on the latest release, v0.55?
Thank you for your contributions.
Initializing in the latest version works. We are however currently unable to upgrade our app to the newest version. The problem though, we didn't upgrade any packages nor did we reinstall any. It just suddenly broke.
same issue is happening with us. no changes done by us, it was working yesterday and today it is showing "React Native version mismatch "
Edit-:
Exact same thing here. I literally didn't touch the app, it was fully functional 2 days ago and now it's giving me this error.

Same thing happened to me. Didn't even open the app recently then now its giving me this error
same issue is happening with us. no changes done by us, it was working yesterday and today it is showing "
React Native version mismatch
JavaScript version:0.50.3
Native version:0.55.3 "
but my react-native -version is:
react-native-cli: 2.0.1
react-native: 0.50.3
It's Android only issue, at least for me. What surprised me is that it is not even 15 minutes apart and I was still testing the working one, then this error occurs.
SOS!! I just bought a cup of coffee, why punish me with this error. :(
facing same issue here :(
Any fix??
facing same issue :(((
What is happening? I didn't change anything
I was also struggling with this. Somebody has added this https://bintray.com/weimob/maven/react-native/0.55.3 and it will break all React Native Android builds that specify jcenter() in project's repositories. To avoid this issue, you should 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 version you're using.
I have the same thing.

@Wiltzu
Am I doing something wrong? For me it looks like this:
dependencies {
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:23.0.1"
compile "com.facebook.react:react-native:+" // From node_modules
}
Changed to this:
dependencies {
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:23.0.1"
compile "com.facebook.react:react-native:0.51.0" { force = true } // From node_modules
}
And I'm getting the following error:
Could not find method com.facebook.react:react-native:0.51.0()
EDIT: I forgot to add the brackets. This is working: Thank you!
dependencies {
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:23.0.1"
compile ("com.facebook.react:react-native:0.51.0") { force = true } // From node_modules
}
Thanks @Wiltzu , that worked a charm
I am also facing this issue. When building android, each package uses wrong version instead of the one specified in packages.json.
"source": "/Users/daniel/workspace/collabee-reactnative/node_modules/react-native-fcm/android/build/intermediates/exploded-aar/com.facebook.react/react-native/0.55.3/res/anim/catalyst_push_up_in.xml"
Anyone knows what's happening now?
@Dror-Bar
Use
compile("com.facebook.react:react-native:0.51.0") { force = true }
Instead of
compile "com.facebook.react:react-native:0.51.0" { force = true }
@Wiltzu 's comment fixed it for me, at least for now!
@bluenex same here worked for me around 2 hrs ago now causing same error as above.
compile("com.facebook.react:react-native:0.51.0") { force = true } fixed it for me. For now.
@Wiltzu Thanks, it works for now
It's working now. go to app/build.gradel
compile("com.facebook.react:react-native:0.53.3") { force = true }
as per your react-native version
@Wiltzu You are a legend man.! Thanks. That saved us.
@mthahzan Thank you for raising it in the right forum.
Thanks @Wiltzu!
Thanks @Wiltzu . it took me 4 hours
Thanks @Wiltzu , it worked!
@Wiltzu you made my day :)
@Wiltzu Thank you.
btw how is this happened ?? and is this a temporary and how is this gonna effect on all of us ?
Thanks @Wiltzu
@Wiltzu after 4 hours of R&D your solution helped. But application was working fine till yesterday, what changes affect to the app of all the developers ?
As mentioned by @Wiltzu it seems that this issue surfaced when someone on maven 'upgraded' the react native dependency.
This means that you need to fix your dependency instead of just depending on "latest" (which is standard behaviour on Android when you don't explicitly say the version number - from my understanding).
I urge you all to properly set fixed version numbers on your gradle files (and also your package.json, and so on) for each dependency in order to avoid these kind of side effects.
Since the issue per se is "not an issue" and there is a workaround for those who are not on latest, I will limit the conversation to avoid spam waves of useless comments.
Again, I urge you to be particularly precise on your Android native configs, since Google is going to enforce some new patterns in terms of dependencies in the comings months - we will create an 'umbrella' issue to list all the changes that this repo will need in order to properly handle them.
Side note, regarding the 'why' this happens:
Once each repository has been inspected for the module, Gradle will choose the 'best' one to use. This is done using the following criteria:
For a dynamic version, a 'higher' concrete version is preferred over a 'lower' version.
Modules declared by a module metadata file (.module, .pom or ivy.xml file) are preferred over modules that have an artifact file only.
Modules from earlier repositories are preferred over modules in later repositories.
When the dependency is declared by a concrete version and a module metadata file is found in a repository, there is no need to continue searching later repositories and the remainder of the process is short-circuited.
Source: https://docs.gradle.org/current/userguide/introduction_dependency_management.html#sec:dependency_resolution
Closing, if you want to know more about how it got fixed you can read the explanation here
Most helpful comment
I was also struggling with this. Somebody has added this https://bintray.com/weimob/maven/react-native/0.55.3 and it will break all React Native Android builds that specify
jcenter()in project's repositories. To avoid this issue, you should force React Native version inandroid/app/build.gradlefile like thiscompile ("com.facebook.react:react-native:0.52.0") { force = true }. Change0.52.0to version you're using.