React-native-firebase: v.5.6.0: Can't build in XCode 11 after upgrading to react native 0.62

Created on 30 Mar 2020  路  3Comments  路  Source: invertase/react-native-firebase


Issue



After upgrading to react native 0.62 I'm getting errors when trying to build the project in XCode 11:
'cstdarg' file not found
Could not build module 'Darwin'
Could not build module 'Foundation'
etc.
image

I'm using react-native-firebase 5.6.0 and can't upgrade at the moment since v.6 doesn't support notifications and a standalone library Notifee is not ready yet.


Project Files






Javascript

Click To Expand

#### `package.json`:

"react-native-firebase": "^5.6.0",
#### `firebase.json` for react-native-firebase v6:
# N/A
### iOS
Click To Expand

#### `ios/Podfile`: - [ ] I'm not using Pods - [x] I'm using Pods and my Podfile looks like:

pod 'Firebase/Core', '~> 6.13.0'
pod 'Firebase/Auth', '~> 6.13.0'
pod 'Firebase/Database', '~> 6.13.0'
pod 'Firebase/RemoteConfig', '~> 6.13.0'
pod 'Firebase/Messaging', '~> 6.13.0'
pod 'Firebase/DynamicLinks', '~> 6.13.0'
pod 'Firebase/InAppMessagingDisplay'
pod 'Fabric', '~> 1.10.1'
pod 'Crashlytics', '~> 3.13.1'
pod 'FBSDKLoginKit'
pod 'FBSDKCoreKit', :modular_headers => true
pod 'FBSDKShareKit'
pod 'Bolts'
pod 'AppsFlyerFramework'

# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

def add_flipper_pods!
  version = '~> 0.33.1'
  pod 'FlipperKit', version, :configuration => 'Debug'
  pod 'FlipperKit/FlipperKitLayoutPlugin', version, :configuration => 'Debug'
  pod 'FlipperKit/SKIOSNetworkPlugin', version, :configuration => 'Debug'
  pod 'FlipperKit/FlipperKitUserDefaultsPlugin', version, :configuration => 'Debug'
  pod 'FlipperKit/FlipperKitReactPlugin', version, :configuration => 'Debug'
end
# Post Install processing for Flipper
def flipper_post_install(installer)
  installer.pods_project.targets.each do |target|
    if target.name == 'YogaKit'
      target.build_configurations.each do |config|
        config.build_settings['SWIFT_VERSION'] = '4.1'
      end
    end
  end
end

target 'myProject' do
  pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
  pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
  pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
  pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"
  pod 'React', :path => '../node_modules/react-native/'
  pod 'React-Core', :path => '../node_modules/react-native/'
  pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
  pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
  pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
  pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
  pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
  pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
  pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
  pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
  pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
  pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
  pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
  pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'
  pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
  pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
  pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
  pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
  pod 'ReactCommon/callinvoker', :path => "../node_modules/react-native/ReactCommon"
  pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
  pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga', :modular_headers => true
  pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
  pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
  pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'

  pod 'react-native-config', :path => '../node_modules/react-native-config'

  pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'

  use_native_modules!
  add_flipper_pods!
end

post_install do |installer|
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable flipper pods and the below line.
flipper_post_install(installer)

installer.pods_project.targets.each do |target|
    if target.name == 'react-native-config'
      phase = target.project.new(Xcodeproj::Project::Object::PBXShellScriptBuildPhase)
      phase.shell_script = "cd ../../"\
      " && RNC_ROOT=./node_modules/react-native-config/"\
      " && export SYMROOT=$RNC_ROOT/ios/ReactNativeConfig"\
      " && ruby $RNC_ROOT/ios/ReactNativeConfig/BuildDotenvConfig.ruby"

      target.build_phases << phase
      target.build_phases.move(phase,0)
    end
  end
 end
# N/A
#### `AppDelegate.m`:
// N/A


Android

Click To Expand

#### Have you converted to AndroidX? - [ ] my application is an AndroidX application? - [ ] I am using `android/gradle.settings` `jetifier=true` for Android compatibility? - [x] I am using the NPM package `jetifier` for react-native compatibility? #### `android/build.gradle`:

// N/A
#### `android/app/build.gradle`:
// N/A
#### `android/settings.gradle`:
// N/A
#### `MainApplication.java`:
// N/A
#### `AndroidManifest.xml`:
<!-- N/A -->


Environment

Click To Expand

**`react-native info` output:**

 System:
    OS: macOS Mojave 10.14.6
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 27.09 MB / 16.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 8.16.0 - /var/folders/hl/xrvrwgcs4g3_pwb1vgz767rc0000gp/T/yarn--1585599803513-0.16439456604551705/node
    Yarn: 1.22.4 - /var/folders/hl/xrvrwgcs4g3_pwb1vgz767rc0000gp/T/yarn--1585599803513-0.16439456604551705/yarn
    npm: 6.4.1 - ~/.nvm/versions/node/v8.16.0/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.9.1 - /Users/me/.rvm/gems/ruby-2.6.5/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
    Android SDK:
      API Levels: 27, 28, 29
      Build Tools: 28.0.2, 28.0.3, 29.0.2
      System Images: android-23 | Google APIs Intel x86 Atom, android-27 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom
      Android NDK: Not Found
  IDEs:
    Android Studio: 3.6 AI-192.7142.36.36.6241897
    Xcode: 11.3.1/11C504 - /usr/bin/xcodebuild
  Languages:
    Python: 2.7.10 - /usr/bin/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.11.0 => 16.11.0
    react-native: 0.62.0 => 0.62.0
  npmGlobalPackages:
    *react-native*: Not Found
- **Platform that you're experiencing the issue on**: - [x ] iOS - [ ] Android - [ ] **iOS** but have not tested behavior on Android - [ ] **Android** but have not tested behavior on iOS - [ ] Both - **`react-native-firebase` version you're using that has this issue:** - `5.6.0` - **`Firebase` module(s) you're using that has the issue:** - `e.g. Instance ID` - **Are you using `TypeScript`?** - `N`



iOS 5.x.x

Most helpful comment

Thanks @mikehardy , I haven't noticed the example generator repo. I have tried it on RN 0.62.0 and it builds fine. It was indeed a local issue, it appeared that we have an explicit Libraries/RNFirebase.xcodeproj subproject (I guess generated during the migration somehow). Removing it solved the current issue.

All 3 comments

If you can reproduce the problem by cloning this repo and running this script, then we can reproduce it - if not then I'm guessing it's a local issue: https://github.com/mikehardy/rnfbdemo/blob/master/make-demo.sh

You can see what it's doing in the comments, but it's basically a react-native "current stable" (I guess it would pull 0.62.0 now, but I'm personally using 0.61.5) and combining it with react-native-firebase v5.6.0 (which I am personally using, and helping maintain here)

Bottom line is it should work - I'm using it in production now. Make sure you've used react-native-clean-project to really nuke everything

Thanks @mikehardy , I haven't noticed the example generator repo. I have tried it on RN 0.62.0 and it builds fine. It was indeed a local issue, it appeared that we have an explicit Libraries/RNFirebase.xcodeproj subproject (I guess generated during the migration somehow). Removing it solved the current issue.

Glad that worked, and +1 on your avatar ;-). The number of ways things can go wrong is certainly always surprising...

Was this page helpful?
0 / 5 - 0 ratings