react-native: React Native version mismatch (on app that was working a couple of hours ago) - Android
- I have reviewed the documentation
- I have searched existing issues
- I am using the latest React Native version
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
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
Steps to Reproduce
react-native init App --version 0.52.0
react-native run-android
Expected Behavior
App should work
Actual Behavior
App doesn’t work
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 13
- Comments: 33 (1 by maintainers)
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.gradle
file like thiscompile ("com.facebook.react:react-native:0.52.0") { force = true }
. Change0.52.0
to version you’re using.@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 }
SOS!! I just bought a cup of coffee, why punish me with this error. 😦
@Wiltzu Am I doing something wrong? For me it looks like this:
Changed to this:
And I’m getting the following error:
EDIT: I forgot to add the brackets. This is working: Thank you!
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.