0

After updating react-native-firebase to 5.0.0 I then had to update to react-native 0.57.1

After updating react native when I go to do react-native run-ios I get a version mismatch error. saying that the javascript version 0.57.1 is different from the native version 0.56.0 I have screenshotted the error below.

React Native Version Mismatch Error

When I try to build the ios project in Xcode I 34 errors related to rnfirebase.

React Native Firebase xcode error

React native firebase xcode error parse issue

React native firebase Xcode error pic 3

I'm sorry if my question is a bit ambiguous but I'm really not sure where to start or where to go, so if someone could point me in the right direction I will be able to better adjust my questions and provide any necessary details.

UPDATE: ADDED PODFILE

Podfile

I get this error after running react-native run-ios

ios build failed error

Thank you for any help

Andrew Irwin
  • 691
  • 12
  • 40

3 Answers3

1

According to the Release notes (https://rnfirebase.io/docs/v5.x.x/release-notes): change your podfile to this.

  pod 'Firebase/Auth', '~> 5.9.0'
  pod 'Firebase/Core', '~> 5.9.0'
  pod 'Firebase/Firestore', '~> 5.9.0'
  pod 'Firebase/DynamicLinks', '~> 5.9.0'
  pod 'Firebase/Storage', '~> 5.9.0'
Maxim Toyberman
  • 1,906
  • 1
  • 20
  • 35
0

After updating package.json depencencies, make sure you run a npm install from your project root, and a pod update from your ios directory.

Also, make sure that no Metro bundler is running while doing that, and no IDE is opened - it could keep an old cached version of your node modules. (hence the watchman watch-del-all command suggested by RN in your screenshot)

Vinzzz
  • 11,746
  • 5
  • 36
  • 42
  • Sorry I clicked accepted the answer by mistake, unfortunately after doing what you said, it still doesnt work, the ios build fails and it appears to be a problem with react-native-firebase. – Andrew Irwin Oct 09 '18 at 13:48
  • and doing a `react-native start --reset-cache` to start Metro ? – Vinzzz Oct 09 '18 at 13:50
  • yes I did watchman watch-del-all && react-native start --reset-cache. I will update my question add the error why the ios build fails . the app works perfect on android – Andrew Irwin Oct 09 '18 at 13:52
  • ah... so it's not the same error as the red screen you had before ! the screenshot you provided doesn't mention the reason for ios build fail – Vinzzz Oct 09 '18 at 13:59
  • ok, to be clear, and sorry If I left this out before, I'm getting two errors, one on the red screen that says about the mismatch, the other on the terminal that I have added above in the question, another thing to note, is that for a few weeks Ive had the error in the terminal saying ios build failed but I could still run the ios app. – Andrew Irwin Oct 09 '18 at 14:03
  • 1
    if ios build fails, then the ios app you can run in your simulator is outdated, so the red screen error is irrelevant, fix the build first – Vinzzz Oct 09 '18 at 14:11
  • to fix the build, please look for the errors causing the build fail, your screenshot is incomplete – Vinzzz Oct 09 '18 at 14:12
  • 1
    also, be sure to start from a clean slate: delete all your XCode `DerivedData` folder content - shortcut from XCode is Shift + alt + command ⌘ + K – Vinzzz Oct 09 '18 at 14:14
  • Thank you, but Im not exactly where to start, there's so many of them, I have posted some of them in the question above, Should I try to completely remove react-native-firebase, (because all the errors seem to be coming from there) then build withouy rnfirebase and then if that works re-install rnfirebase – Andrew Irwin Oct 09 '18 at 14:16
0

Thank you for all the answers and comments, unfortunately, none of them worked for me. Ultimately what lead me in the right direction was a comment from @Vinzzz:

if ios build fails, then the ios app you can run in your simulator is outdated, so the red screen error is irrelevant, fix the build first

I went back to Xcode, tried to decipher the 34 errors, I found that they all seem to be coming from rnfirebase, I tried to search SO for answers how to fix them, but couldn't fix them.

I ended up just completely removing rnfirebase from the ios project and mostly from the reactnativejavascript project but kept it in the Android project as I had no problem there.

I think first I found on SO, to remove the pods in the pod file then do:

pod install

which removed the rmfirebase pods

I then deleted any reference to rnfirebase that was left in project, using search project. After that I removed rnfirebase from package.json, npm install to remove it from modules, and it worked ! all errors gone, build succeded! after commenting out some references to rnfirebase in my logic, I ran run-ios and it worked too! no react-native mismatch error.

I have since updated everything and re-installed rnfirebase and its working again! and now everything is on the latest versions where it wasnt before. Thank you to everyone and especially to @Vinzz for pointing in the right direction, took me 8 days to get over this! I tried to fix the problems instead of just uninstalling & re-installing thats why it took me so long. cheers

Andrew Irwin
  • 691
  • 12
  • 40