react-native-firebase icon indicating copy to clipboard operation
react-native-firebase copied to clipboard

[🐛] 'FirebaseCoreExtension/FIRLibrary.h' file not found

Open FelipeLimaDeSouza opened this issue 2 years ago • 38 comments

I updated my reac-native-firebase version to 15.0.0 Later I didn't start my project.

Error on: RNFBCrashlyticsInitProvider: 'FirebaseCoreExtension/FIRLibrary.h' file not found

My Podfile

$RNFirebaseAnalyticsWithoutAdIdSupport=true
$RNFirebaseAsStaticFramework=true

require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '13.0'
use_frameworks!

permissions_path = '../node_modules/react-native-permissions/ios'

target 'App' do
  config = use_native_modules!

  use_react_native!(:path => config["reactNativePath"])

  pod 'CryptoSwift', '1.4.0'
  pod 'SharkORM', '2.3.62'
  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable these next few lines.
  # use_flipper!({ 'Flipper-Folly' => '2.5.3', 'Flipper' => '0.87.0', 'Flipper-RSocket' => '1.3.1' })
  pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'

  pod 'Permission-Camera', :path => "#{permissions_path}/Camera"
  pod 'Permission-PhotoLibrary', :path => "#{permissions_path}/PhotoLibrary"
  pod 'Permission-PhotoLibraryAddOnly', :path => "#{permissions_path}/PhotoLibraryAddOnly"
  pod 'Permission-LocationAlways', :path => "#{permissions_path}/LocationAlways"

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

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


  post_install do |installer|
    react_native_post_install(installer)
    __apply_Xcode_12_5_M1_post_install_workaround(installer)
    # flipper_post_install(installer)
    
  end

  $static_framework = [
    'CocoaAsyncSocket', 'ComponentKit',
    'CocoaLibEvent', 'OpenSSL-Universal', 'boost-for-react-native',
    'RNFBApp', 'RNFBAuth', 'RNFBFirestore', 'RNFBStorage', 'RNFBDatabase',
    'RNFBDynamicLinks', 'RNFBPerf', 'RNFBAnalytics', 'RNFBCrashlytics',
    'Permission-Camera', 'Permission-PhotoLibrary', 'Permission-PhotoLibraryAddOnly',
    'Permission-LocationAlways',
    'RNPermissions']

  pre_install do |installer|
    Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}

    installer.pod_targets.each do |pod|
        if $static_framework.include?(pod.name)
          def pod.build_type;
            Pod::BuildType.static_library
          end
        end
    end
  end

end

My package.json (react and react native version)

"react": "^17.0.2",
"react-native": "^0.67.4",

My package.json (firebase version)

"@react-native-firebase/analytics": "^15.0.0",
"@react-native-firebase/app": "^15.0.0",
"@react-native-firebase/crashlytics": "^15.0.0",
"@react-native-firebase/database": "^15.0.0",

OS Version

macOs Monterrey 12.4 Xcode 13.4.1

FelipeLimaDeSouza avatar Jun 20 '22 20:06 FelipeLimaDeSouza

Hmm, something's not right.

I don't know about this bit:


  $static_framework = [
    'CocoaAsyncSocket', 'ComponentKit',
    'CocoaLibEvent', 'OpenSSL-Universal', 'boost-for-react-native',
    'RNFBApp', 'RNFBAuth', 'RNFBFirestore', 'RNFBStorage', 'RNFBDatabase',
    'RNFBDynamicLinks', 'RNFBPerf', 'RNFBAnalytics', 'RNFBCrashlytics',
    'Permission-Camera', 'Permission-PhotoLibrary', 'Permission-PhotoLibraryAddOnly',
    'Permission-LocationAlways',
    'RNPermissions']

  pre_install do |installer|
    Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}

Looks like a workaround we haven't verified. That's not how I developed the new version.

Rip all that out, just do use_frameworks!, see how it goes ?

Make sure this is there? https://rnfirebase.io/#allow-ios-static-frameworks ($RNFirebaseAsStaticFramework = true in your Podfile, then reinstall pods)

Additionally, you've purged out all sorts of other useful info like, for instance, what version of react-native are you on? What version of macOS / Xcode?

I just updated my demo script to verify this all can work and it works for me with the appropriate static frameworks updates: https://github.com/mikehardy/rnfbdemo/blob/main/make-demo.sh

mikehardy avatar Jun 20 '22 20:06 mikehardy

Hmm, something's not right.

I don't know about this bit:


  $static_framework = [
    'CocoaAsyncSocket', 'ComponentKit',
    'CocoaLibEvent', 'OpenSSL-Universal', 'boost-for-react-native',
    'RNFBApp', 'RNFBAuth', 'RNFBFirestore', 'RNFBStorage', 'RNFBDatabase',
    'RNFBDynamicLinks', 'RNFBPerf', 'RNFBAnalytics', 'RNFBCrashlytics',
    'Permission-Camera', 'Permission-PhotoLibrary', 'Permission-PhotoLibraryAddOnly',
    'Permission-LocationAlways',
    'RNPermissions']

  pre_install do |installer|
    Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}

Looks like a workaround we haven't verified. That's not how I developed the new version.

Rip all that out, just do use_frameworks!, see how it goes ?

Make sure this is there? https://rnfirebase.io/#allow-ios-static-frameworks ($RNFirebaseAsStaticFramework = true in your Podfile, then reinstall pods)

Additionally, you've purged out all sorts of other useful info like, for instance, what version of react-native are you on? What version of macOS / Xcode?

I just updated my demo script to verify this all can work and it works for me with the appropriate static frameworks updates: https://github.com/mikehardy/rnfbdemo/blob/main/make-demo.sh

I updated my issue with O.S and RN version I removed the static_framework but not working Now my file is like:

$RNFirebaseAnalyticsWithoutAdIdSupport=true
$RNFirebaseAsStaticFramework=true

require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '13.0'
use_frameworks!

permissions_path = '../node_modules/react-native-permissions/ios'

target 'App' do
  config = use_native_modules!

  use_react_native!(:path => config["reactNativePath"])

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

  pod 'Permission-Camera', :path => "#{permissions_path}/Camera"
  pod 'Permission-PhotoLibrary', :path => "#{permissions_path}/PhotoLibrary"
  pod 'Permission-PhotoLibraryAddOnly', :path => "#{permissions_path}/PhotoLibraryAddOnly"
  pod 'Permission-LocationAlways', :path => "#{permissions_path}/LocationAlways"

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

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


  post_install do |installer|
    react_native_post_install(installer)
    __apply_Xcode_12_5_M1_post_install_workaround(installer)
  end

end

FelipeLimaDeSouza avatar Jun 20 '22 20:06 FelipeLimaDeSouza

All I can say is I have a fully scripted demo with comments on what each step is doing, and you can run it and it works - the make-demo.sh script

Please try it to make sure it works - somewhere in the difference between what it does and your project is the difference, but I'd like to see if the demo works in your environment, then you can start looking for differences? There must be something different in the Podfile from the demo and your project. Versions seem okay, I don't think react-native 0.67 vs 0.68 will matter though that is a difference

mikehardy avatar Jun 20 '22 21:06 mikehardy

Also had this issue and had to downgrade back to 14.11.0 got it after attempting the workarounds in https://github.com/facebook/react-native/issues/32451

enchorb avatar Jun 20 '22 22:06 enchorb

Does https://github.com/mikehardy/rnfbdemo/blob/main/make-demo.sh work for you in your environment @enchorb ?

mikehardy avatar Jun 21 '22 02:06 mikehardy

Incidentally - @enchorb hermes will not work until this is released: https://github.com/facebook/react-native/pull/34030#issuecomment-1160987749 - which will likely be react-native 0.69.1 (note: 0.69.0 is not out yet but it's closed for pick requests now and this hermes fix literally just merged a few minutes ago)

Right now for react-native-firebase v15 you need react-native 0.68.2 or lower, hermes off, flipper off, and not the react native new architecture. The changelog mentions the same along with some links for more details on progress removing those restrictions.

[update - I've got a patch for react-native 0.69.0 that lets it work, with hermes even, just no flipper or new architecture: https://github.com/mikehardy/rnfbdemo/blob/main/patches/react-native%2B0.69.0.patch ]

mikehardy avatar Jun 21 '22 02:06 mikehardy

I had the same issue in my project, and I have just run the make-demo script and it's the same issue.

❌  /rnfbdemo/rnfbdemo/node_modules/@react-native-firebase/crashlytics/ios/RNFBCrashlytics/RNFBCrashlyticsInitProvider.h:18:9: 'FirebaseCoreExtension/FIRLibrary.h' file not found

#import <FirebaseCoreExtension/FIRLibrary.h>
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I'm using Xcode 13.4.1 (13F100)

Fawxy avatar Jun 21 '22 07:06 Fawxy

@Fawxy - can you specify anything more about your environment than

I'm using Xcode 13.4.1 (13F100)

?

In my "seems to work fine" environment(s) I have this for instance:

$ /Users/mike/work/Invertase/rnfbdemo/rnfbdemo/node_modules/.bin/react-native info
info Fetching system and libraries information...
System:
    OS: macOS 12.4
    CPU: (12) x64 Intel Core Processor (Skylake)
    Memory: 268.38 MB / 16.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 16.15.1 - /var/folders/8q/bdwkf_zx2hl8_5k2920t28m40000gn/T/yarn--1655780212104-0.5449825354184776/node
    Yarn: 1.22.19 - /var/folders/8q/bdwkf_zx2hl8_5k2920t28m40000gn/T/yarn--1655780212104-0.5449825354184776/yarn
    npm: 8.12.1 - ~/.nvm/versions/node/v16.15.1/bin/npm
    Watchman: 2022.06.13.00 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.11.3 - /Users/mike/.rvm/gems/ruby-3.1.2/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
    Android SDK:
      API Levels: 28, 30, 31, 32
      Build Tools: 30.0.2, 30.0.3, 31.0.0, 32.0.0, 32.1.0
      System Images: android-31 | Google APIs Intel x86 Atom_64
      Android NDK: Not Found
  IDEs:
    Android Studio: 2021.2 AI-212.5712.43.2112.8609683
    Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.15 - /Library/Java/JavaVirtualMachines/temurin-11.jdk/Contents/Home/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.2 => 17.0.2 
    react-native: 0.68.2 => 0.68.2 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found
✨  Done in 3.67s.

mikehardy avatar Jun 21 '22 12:06 mikehardy

I have the same problem

react-native info :

System:
    OS: macOS 12.4
    CPU: (8) arm64 Apple M1
    Memory: 91.44 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.3.0 - /opt/homebrew/bin/node
    Yarn: Not Found
    npm: 8.11.0 - /opt/homebrew/bin/npm
    Watchman: 2022.06.06.00 - /opt/homebrew/bin/watchman
  Managers:
    CocoaPods: 1.11.3 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
    Android SDK: Not Found
  IDEs:
    Android Studio: 2021.2 AI-212.5712.43.2112.8609683
    Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.15 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.2 => 17.0.2 
    react-native: 0.68.2 => 0.68.2 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found`

PodFile

$RNFirebaseAsStaticFramework = true
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '11.0'
install! 'cocoapods', :deterministic_uuids => false

target 'ProjectName' do
  use_frameworks!

  config = use_native_modules!

  # Flags change depending on the env values.
  flags = get_default_flags()

  use_react_native!(
    :path => config[:reactNativePath],
    # to enable hermes on iOS, change `false` to `true` and then install pods
    :hermes_enabled => flags[:hermes_enabled],
    :fabric_enabled => flags[:fabric_enabled],
    # An absolute path to your application root.
    :app_path => "#{Pod::Config.instance.installation_root}/.."
  )

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

  target 'ProjectNameTests' do
    inherit! :complete
    # Pods for testing
  end

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable the next line.
  # use_flipper!()

  post_install do |installer|
    react_native_post_install(installer)
    __apply_Xcode_12_5_M1_post_install_workaround(installer)
  end
end

error log:

❌  ProjectPath/node_modules/@react-native-firebase/crashlytics/ios/RNFBCrashlytics/RNFBCrashlyticsInitProvider.h:18:9: 'FirebaseCoreExtension/FIRLibrary.h' file not found

#import <FirebaseCoreExtension/FIRLibrary.h>

KubilayKerim avatar Jun 21 '22 12:06 KubilayKerim

Here's what make-demo results in, compare and constrast, perhaps modify your Podfile to look like it?

require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '11.0'
install! 'cocoapods', :deterministic_uuids => false

target 'rnfbdemo' do
  config = use_native_modules!
  config = use_frameworks!
  $RNFirebaseAsStaticFramework = true

  # Flags change depending on the env values.
  flags = get_default_flags()

  use_react_native!(
    :path => config[:reactNativePath],
    # to enable hermes on iOS, change `false` to `true` and then install pods
    :hermes_enabled => flags[:hermes_enabled],
    :fabric_enabled => flags[:fabric_enabled],
    # An absolute path to your application root.
    :app_path => "#{Pod::Config.instance.installation_root}/.."
  )

  $FirebaseSDKVersion = '9.1.0'
  target 'rnfbdemoTests' do
    inherit! :complete
    # Pods for testing
  end

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable the next line.
  #use_flipper!()

  post_install do |installer|
    react_native_post_install(installer)
    
    installer.aggregate_targets.each do |aggregate_target|
      aggregate_target.user_project.native_targets.each do |target|
        target.build_configurations.each do |config|
          config.build_settings['LIBRARY_SEARCH_PATHS'] = ['$(SDKROOT)/usr/lib/swift', '$(SDKROOT)/System/iOSSupport/usr/lib/swift', '$(inherited)']
        end
      end
      aggregate_target.user_project.save
    end
    
    installer.pods_project.targets.each do |target|
      if target.respond_to?(:product_type) and target.product_type == "com.apple.product-type.bundle"
        target.build_configurations.each do |config|
          config.build_settings["CODE_SIGN_IDENTITY[sdk=macosx*]"] = "-"
        end
      end
    end
    installer.pods_project.targets.each do |target|
      if (target.name.eql?('FBReactNativeSpec'))
        target.build_phases.each do |build_phase|
          if (build_phase.respond_to?(:name) && build_phase.name.eql?('[CP-User] Generate Specs'))
            target.build_phases.move(build_phase, 0)
          end
        end
      end
    end
    
    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings["GCC_WARN_INHIBIT_ALL_WARNINGS"] = "YES"
      end
    end
    
    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings["CC"] = "clang"
        config.build_settings["LD"] = "clang"
        config.build_settings["CXX"] = "clang++"
        config.build_settings["LDPLUSPLUS"] = "clang++"
      end
    end
    
    installer.aggregate_targets.each do |aggregate_target|
      aggregate_target.user_project.native_targets.each do |target|
        target.build_configurations.each do |config|
          config.build_settings['ONLY_ACTIVE_ARCH'] = 'YES'
          config.build_settings['EXCLUDED_ARCHS'] = 'i386'
        end
      end
      aggregate_target.user_project.save
    end
    __apply_Xcode_12_5_M1_post_install_workaround(installer)
  end
end

Screenshot from 2022-06-21 07-38-45

mikehardy avatar Jun 21 '22 12:06 mikehardy

Mike thank you for your quick reply I did change Podfile as you requested did a pod install and run-ios it did give this error again :

❌  projectpath/node_modules/@react-native-firebase/crashlytics/ios/RNFBCrashlytics/RNFBCrashlyticsInitProvider.h:18:9: 'FirebaseCoreExtension/FIRLibrary.h' file not found

#import <FirebaseCoreExtension/FIRLibrary.h>
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


▸ Compiling RNFBCrashlyticsInitProvider.m

❌  projectpath/node_modules/@react-native-firebase/crashlytics/ios/RNFBCrashlytics/RNFBCrashlyticsInitProvider.h:18:9: 'FirebaseCoreExtension/FIRLibrary.h' file not found

#import <FirebaseCoreExtension/FIRLibrary.h>

▸ Compiling RNFBCrashlytics-dummy.m
▸ Compiling RNFBAppDistribution_vers.c
▸ Compiling RNFBAppDistributionModule.m
▸ Compiling RNFBAppDistribution-dummy.m
▸ Compiling RCTTypedModuleConstants.mm
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening projectname.xcworkspace.

KubilayKerim avatar Jun 21 '22 12:06 KubilayKerim

@KubilayKerim how did it go when you actually ran https://github.com/mikehardy/rnfbdemo/blob/main/make-demo.sh in your environment ? I cannot troubleshoot specific projects as there are an infinite variety of ways people can do things that fail. So I offer that script which builds things from scratch and allows us to make solid assumptions about what is actually in the project (since it's constructed in a fully automated way)

mikehardy avatar Jun 21 '22 13:06 mikehardy

Also had this issue and had to downgrade back to 14.11.0 got it after attempting the workarounds in facebook/react-native#32451

It's working for me. Tks

@mikehardy rollback version to 14.11.0 is working for me

FelipeLimaDeSouza avatar Jun 21 '22 14:06 FelipeLimaDeSouza

@mikehardy rollback version to 14.11.0 is working for me

Which unfortunately leaves you with no future as you can't stay there forever.

Does https://github.com/mikehardy/rnfbdemo/blob/main/make-demo.sh work for you in your environment ?

mikehardy avatar Jun 21 '22 14:06 mikehardy

@mikehardy rollback version to 14.11.0 is working for me

Which unfortunately leaves you with no future as you can't stay there forever.

Does https://github.com/mikehardy/rnfbdemo/blob/main/make-demo.sh work for you in your environment ?

Using make-demo.sh I had a problem in build project too Error:

'Firebase.h' file not found

FelipeLimaDeSouza avatar Jun 21 '22 16:06 FelipeLimaDeSouza

Oh dang 🤦 you all - I made local changes to the make-demo.sh script in order to work with the new firebase-ios-sdk v9 but I did not then git push them !

So if you have already run it before just this minute, it would probably still have the problems like everyone is experiencing here, but of course it worked for me (with my last changes: https://github.com/mikehardy/rnfbdemo/commit/c73821853723ab4e59c25c58a1e1bc853c6f3ae4)

Totally my fault, you have my sincere apologies if this wasted your time.

Please if you are having these problems, do a total rm -rf on the rnfbdemo directory, make sure you have the most up to date version of https://github.com/mikehardy/rnfbdemo/blob/main/make-demo.sh and try again 🙏

Sorry for the hassle.

mikehardy avatar Jun 21 '22 17:06 mikehardy

I did run your new script following appeared in the end :

Copying_ demonstrator App.js
cp: ../App.js: No such file or directory

KubilayKerim avatar Jun 22 '22 07:06 KubilayKerim

I've rerun the build script from scratch and it seems to be working as expected. Here is my react-native info of the project that does not work with v15

System:
    OS: macOS 12.4
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 29.50 MB / 32.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.13.0 - ~/.nvm/versions/node/v16.13.0/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 8.1.0 - ~/.nvm/versions/node/v16.13.0/bin/npm
    Watchman: 2022.05.30.00 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.11.3 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
    Android SDK: Not Found
  IDEs:
    Android Studio: 2021.2 AI-212.5712.43.2112.8609683
    Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.11 - /Users/chrisbyatt/.jenv/shims/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.2 => 17.0.2 
    react-native: 0.68.2 => 0.68.2 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Fawxy avatar Jun 22 '22 08:06 Fawxy

get same error xcode 65 on both make-demo.sh project and my current project.

Demo project info:

System:
    OS: macOS 12.4
    CPU: (8) x64 Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz
    Memory: 105.46 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.13.1 - ~/.nvm/versions/node/v16.13.1/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v16.13.1/bin/yarn
    npm: 8.1.2 - ~/.nvm/versions/node/v16.13.1/bin/npm
    Watchman: 2022.03.14.00 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.11.3 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
    Android SDK: Not Found
  IDEs:
    Android Studio: 2021.1 AI-211.7628.21.2111.8193401
    Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.11 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.2 => 17.0.2 
    react-native: 0.68.2 => 0.68.2 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Main project info:

System:
    OS: macOS 12.4
    CPU: (8) x64 Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz
    Memory: 130.95 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.13.1 - ~/.nvm/versions/node/v16.13.1/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v16.13.1/bin/yarn
    npm: 8.1.2 - ~/.nvm/versions/node/v16.13.1/bin/npm
    Watchman: 2022.03.14.00 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.11.3 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
    Android SDK: Not Found
  IDEs:
    Android Studio: 2021.1 AI-211.7628.21.2111.8193401
    Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.11 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.1 => 17.0.1 
    react-native: 0.64.1 => 0.64.1 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

baselshlewett avatar Jun 22 '22 14:06 baselshlewett

@baselshlewett Xcode error 65 is because the build is not finding node, this is a common and unfortunate side effect of using nvm. react-native 0.69 changes how react-native build process handles node binary discovery to be more explicit, see https://github.com/facebook/react-native-website/pull/3164/files?diff=unified&w=0#diff-142116f60ef18d7f15a7b55492990a77fb5092914aeaf06d391b113105925c3fR49

Until then, make temporary symbol link to the node you want in your PATH somewhere (for example /usr/local/bin or something) and re-try. It should work.


@Fawxy This is critical, thank you for the report

I've rerun the build script from scratch and it seems to be working as expected

That tells me it is possible. Things are working, but there are project-specific issues meaning the v14->v15 update steps are the issue, and they have not been done correctly in the specific project.


@KubilayKerim This

Copying_ demonstrator App.js cp: ../App.js: No such file or directory

Tells me you maybe ran the script but you did not actually clone the repository to run it, so App.js does not exist? That's not a valid test result then. Clone the repo to run the script

mikehardy avatar Jun 22 '22 14:06 mikehardy

@baselshlewett Xcode error 65 is because the build is not finding node, this is a common and unfortunate side effect of using nvm. react-native 0.69 changes how react-native build process handles node binary discovery to be more explicit, see https://github.com/facebook/react-native-website/pull/3164/files?diff=unified&w=0#diff-142116f60ef18d7f15a7b55492990a77fb5092914aeaf06d391b113105925c3fR49

Until then, make temporary symbol link to the node you want in your PATH somewhere (for example /usr/local/bin or something) and re-try. It should work.

@Fawxy This is critical, thank you for the report

I've rerun the build script from scratch and it seems to be working as expected

That tells me it is possible. Things are working, but there are project-specific issues meaning the v14->v15 update steps are the issue, and they have not been done correctly in the specific project.

@KubilayKerim This

Copying_ demonstrator App.js cp: ../App.js: No such file or directory

Tells me you maybe ran the script but you did not actually clone the repository to run it, so App.js does not exist? That's not a valid test result then. Clone the repo to run the script

Fair enough, I'll give it a go if I manage it.

Worth noting though that this issue occurred after I updated rnfirebase to 15 and had no issues with version 14. Running the build through xcode throws same error as mentioned in original ticket.

baselshlewett avatar Jun 22 '22 15:06 baselshlewett

@mikehardy sorry my bad I did clone and re run script but I am still a loss following error :

Installing pods and running iOS app in debug mode
Scanning for pods...
1.11.3
> pod install
RNFBAnalytics: Using default Firebase/Analytics with Ad Ids. May require App Tracking Transparency. Not allowed for Kids apps.
RNFBAnalytics: You may set variable `$RNFirebaseAnalyticsWithoutAdIdSupport=true` in Podfile to use analytics without ad ids.
Using firebase.json from '/Users/user/Desktop/rnfbdemo/rnfbdemo/firebase.json'
Adding a custom script phase for Pod RNFBApp: [RNFB] Core Configuration
Adding a custom script phase for Pod RNFBCrashlytics: [RNFB] Crashlytics Configuration
Auto-linking React Native modules for target `rnfbdemo`: RNFBAnalytics, RNFBApp, RNFBAppCheck, RNFBAppDistribution, RNFBAuth, RNFBCrashlytics, RNFBDatabase, RNFBDynamicLinks, RNFBFirestore, RNFBFunctions, RNFBInAppMessaging, RNFBInstallations, RNFBMessaging, RNFBPerf, RNFBRemoteConfig, and RNFBStorage
[Codegen] Generating ./build/generated/ios/React-Codegen.podspec.json
Analyzing dependencies
[Codegen] Found FBReactNativeSpec
RNFBAnalytics: Using user specified Firebase SDK version '9.2.0'
RNFBAnalytics: Using default Firebase/Analytics with Ad Ids. May require App Tracking Transparency. Not allowed for Kids apps.
RNFBAnalytics: You may set variable `$RNFirebaseAnalyticsWithoutAdIdSupport=true` in Podfile to use analytics without ad ids.
RNFBAnalytics: Using overridden static_framework value of 'true'
RNFBApp: Using user specified Firebase SDK version '9.2.0'
RNFBApp: Using overridden static_framework value of 'true'
RNFBAppCheck: Using user specified Firebase SDK version '9.2.0'
RNFBAppCheck: Using overridden static_framework value of 'true'
RNFBAppDistribution: Using user specified Firebase SDK version '9.2.0'
RNFBAppDistribution: Using overridden static_framework value of 'true'
RNFBAuth: Using user specified Firebase SDK version '9.2.0'
RNFBAuth: Using overridden static_framework value of 'true'
RNFBCrashlytics: Using user specified Firebase SDK version '9.2.0'
RNFBCrashlytics: Using overridden static_framework value of 'true'
RNFBDatabase: Using user specified Firebase SDK version '9.2.0'
RNFBDatabase: Using overridden static_framework value of 'true'
RNFBDynamicLinks: Using user specified Firebase SDK version '9.2.0'
RNFBDynamicLinks: Using overridden static_framework value of 'true'
RNFBFirestore: Using user specified Firebase SDK version '9.2.0'
RNFBFirestore: Using overridden static_framework value of 'true'
RNFBFunctions: Using user specified Firebase SDK version '9.2.0'
RNFBFunctions: Using overridden static_framework value of 'true'
RNFBInAppMessaging: Using user specified Firebase SDK version '9.2.0'
RNFBInAppMessaging: Using overridden static_framework value of 'true'
RNFBInstallations: Using user specified Firebase SDK version '9.2.0'
RNFBInstallations: Using overridden static_framework value of 'true'
RNFBMessaging: Using user specified Firebase SDK version '9.2.0'
RNFBMessaging: Using overridden static_framework value of 'true'
RNFBPerf: Using user specified Firebase SDK version '9.2.0'
RNFBPerf: Using overridden static_framework value of 'true'
RNFBRemoteConfig: Using user specified Firebase SDK version '9.2.0'
RNFBRemoteConfig: Using overridden static_framework value of 'true'
RNFBStorage: Using user specified Firebase SDK version '9.2.0'
RNFBStorage: Using overridden static_framework value of 'true'
[!] CocoaPods could not find compatible versions for pod "Firebase/Messaging":
  In Podfile:
    RNFBMessaging (from `../node_modules/@react-native-firebase/messaging`) was resolved to 15.0.0, which depends on
      Firebase/Messaging (= 9.2.0)

None of your spec sources contain a spec satisfying the dependency: `Firebase/Messaging (= 9.2.0)`.

You have either:
 * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
 * mistyped the name or version.
 * not added the source repo that hosts the Podspec to your Podfile.
Couldn't install Pods. Updating the Pods project and trying again...
> pod install --repo-update
RNFBAnalytics: Using default Firebase/Analytics with Ad Ids. May require App Tracking Transparency. Not allowed for Kids apps.
RNFBAnalytics: You may set variable `$RNFirebaseAnalyticsWithoutAdIdSupport=true` in Podfile to use analytics without ad ids.
Using firebase.json from '/Users/user/Desktop/rnfbdemo/rnfbdemo/firebase.json'
Adding a custom script phase for Pod RNFBApp: [RNFB] Core Configuration
Adding a custom script phase for Pod RNFBCrashlytics: [RNFB] Crashlytics Configuration
Auto-linking React Native modules for target `rnfbdemo`: RNFBAnalytics, RNFBApp, RNFBAppCheck, RNFBAppDistribution, RNFBAuth, RNFBCrashlytics, RNFBDatabase, RNFBDynamicLinks, RNFBFirestore, RNFBFunctions, RNFBInAppMessaging, RNFBInstallations, RNFBMessaging, RNFBPerf, RNFBRemoteConfig, and RNFBStorage
[Codegen] Generating ./build/generated/ios/React-Codegen.podspec.json
Updating local specs repositories

――― MARKDOWN TEMPLATE ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

### Command

/usr/local/bin/pod install --repo-update --ansi


### Report

* What did you do?

* What did you expect to happen?

* What happened instead?


### Stack

CocoaPods : 1.11.3 Ruby : ruby 2.6.8p205 (2021-07-07 revision 67951) [universal.arm64e-darwin21] RubyGems : 3.0.3.1 Host : macOS 12.4 (21F79) Xcode : 13.4.1 (13F100) Git : git version 2.32.1 (Apple Git-133) Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib Repositories : trunk - CDN - https://cdn.cocoapods.org/


### Plugins

cocoapods-deintegrate : 1.0.5 cocoapods-plugins : 1.0.0 cocoapods-search : 1.0.1 cocoapods-trunk : 1.6.0 cocoapods-try : 1.2.0


### Podfile

```ruby
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '12.4'
install! 'cocoapods', :deterministic_uuids => false

target 'rnfbdemo' do
  config = use_native_modules!
  config = use_frameworks!
  $RNFirebaseAsStaticFramework = true

  # Flags change depending on the env values.
  flags = get_default_flags()

  use_react_native!(
    :path => config[:reactNativePath],
    # to enable hermes on iOS, change `false` to `true` and then install pods
    :hermes_enabled => flags[:hermes_enabled],
    :fabric_enabled => flags[:fabric_enabled],
    # An absolute path to your application root.
    :app_path => "#{Pod::Config.instance.installation_root}/.."
  )

  $FirebaseSDKVersion = '9.2.0'
  target 'rnfbdemoTests' do
    inherit! :complete
    # Pods for testing
  end

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable the next line.
  #use_flipper!()

  post_install do |installer|
    react_native_post_install(installer)
    installer.pods_project.targets.each do |target|
      if (target.name.eql?('FBReactNativeSpec'))
        target.build_phases.each do |build_phase|
          if (build_phase.respond_to?(:name) && build_phase.name.eql?('[CP-User] Generate Specs'))
            target.build_phases.move(build_phase, 0)
          end
        end
      end
    end
    
    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings["GCC_WARN_INHIBIT_ALL_WARNINGS"] = "YES"
      end
    end
    
    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings["CC"] = "clang"
        config.build_settings["LD"] = "clang"
        config.build_settings["CXX"] = "clang++"
        config.build_settings["LDPLUSPLUS"] = "clang++"
      end
    end
    
    installer.aggregate_targets.each do |aggregate_target|
      aggregate_target.user_project.native_targets.each do |target|
        target.build_configurations.each do |config|
          config.build_settings['ONLY_ACTIVE_ARCH'] = 'YES'
          config.build_settings['EXCLUDED_ARCHS'] = 'i386'
        end
      end
      aggregate_target.user_project.save
    end
    __apply_Xcode_12_5_M1_post_install_workaround(installer)
  end
end

Error

LoadError - dlopen(/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.5/lib/ffi_c.bundle, 0x0009): tried: '/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.5/lib/ffi_c.bundle' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')) - /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.5/lib/ffi_c.bundle
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.5/lib/ffi.rb:5:in `rescue in <top (required)>'
/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.5/lib/ffi.rb:2:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Library/Ruby/Gems/2.6.0/gems/ethon-0.15.0/lib/ethon.rb:3:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Library/Ruby/Gems/2.6.0/gems/typhoeus-1.4.0/lib/typhoeus.rb:2:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.3/lib/cocoapods-core/cdn_source.rb:440:in `download_typhoeus_impl_async'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.3/lib/cocoapods-core/cdn_source.rb:372:in `download_and_save_with_retries_async'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.3/lib/cocoapods-core/cdn_source.rb:365:in `download_file_async'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.3/lib/cocoapods-core/cdn_source.rb:338:in `download_file'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.3/lib/cocoapods-core/cdn_source.rb:78:in `deprecated_local_podspecs'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.3/lib/cocoapods-core/cdn_source.rb:60:in `preheat_existing_files'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.3/lib/cocoapods-core/cdn_source.rb:257:in `update'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/sources_manager.rb:144:in `block (3 levels) in update'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/sources_manager.rb:143:in `block (2 levels) in update'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/sources_manager.rb:142:in `each'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/sources_manager.rb:142:in `block in update'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/sources_manager.rb:140:in `open'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/sources_manager.rb:140:in `update'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:145:in `block in update_repositories'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:143:in `each'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:143:in `update_repositories'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:237:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:236:in `resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:161:in `install!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/command/install.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/claide-1.1.0/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'

――― TEMPLATE END ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

[!] Oh no, an error occurred.

Search for existing GitHub issues similar to yours: https://github.com/CocoaPods/CocoaPods/search?q=dlopen%28%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.15.5%2Flib%2Fffi_c.bundle%2C+0x0009%29%3A+tried%3A+%27%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.15.5%2Flib%2Fffi_c.bundle%27+%28mach-o+file%2C+but+is+an+incompatible+architecture+%28have+%27x86_64%27%2C+need+%27arm64e%27%29%29+-+%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.15.5%2Flib%2Fffi_c.bundle&type=Issues

If none exists, create a ticket, with the template displayed above, on: https://github.com/CocoaPods/CocoaPods/issues/new

Be sure to first read the contributing guide for details on how to properly submit a ticket: https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md

Don't forget to anonymize any private data!

Looking for related issues on cocoapods/cocoapods... Couldn't install Pods. Updating the Pods project and trying again... Command pod install failed. └─ Cause: Oh no, an error occurred.

Search for existing GitHub issues similar to yours: https://github.com/CocoaPods/CocoaPods/search?q=dlopen%28%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.15.5%2Flib%2Fffi_c.bundle%2C+0x0009%29%3A+tried%3A+%27%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.15.5%2Flib%2Fffi_c.bundle%27+%28mach-o+file%2C+but+is+an+incompatible+architecture+%28have+%27x86_64%27%2C+need+%27arm64e%27%29%29+-+%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.15.5%2Flib%2Fffi_c.bundle&type=Issues

If none exists, create a ticket, with the template displayed above, on: https://github.com/CocoaPods/CocoaPods/issues/new

Be sure to first read the contributing guide for details on how to properly submit a ticket: https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md

Don't forget to anonymize any private data!

Looking for related issues on cocoapods/cocoapods...

KubilayKerim avatar Jun 24 '22 13:06 KubilayKerim

This appears pretty prescriptive @KubilayKerim -

[!] CocoaPods could not find compatible versions for pod "Firebase/Messaging":
  In Podfile:
    RNFBMessaging (from `../node_modules/@react-native-firebase/messaging`) was resolved to 15.0.0, which depends on
      Firebase/Messaging (= 9.2.0)

None of your spec sources contain a spec satisfying the dependency: `Firebase/Messaging (= 9.2.0)`.

You have either:
 * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
 * mistyped the name or version.
 * not added the source repo that hosts the Podspec to your Podfile.

This part:

None of your spec sources contain a spec satisfying the dependency: Firebase/Messaging (= 9.2.0).

So, how did it go when you did this part?

  • out-of-date source repos which you can update with pod repo update or with pod install --repo-update.

mikehardy avatar Jun 24 '22 15:06 mikehardy

Current status here for me is that this is still not reproducible. I continue working on making the experience better though and current state is that with this patch (which is what will be released in react-native 0.69.1) I even have this working:

  • react-native-firebase v15+
  • react-native-google-mobile-ads v7+
  • react-native 0.69.0 + hermes

I qualify this stuff and prove to myself that it's working literally multiple times a day, from scratch using this script https://github.com/mikehardy/rnfbdemo/blob/main/make-demo.sh

Any note about build failures should be similarly reproducible so if there is a problem we may conclusively identify + fix it

mikehardy avatar Jun 25 '22 14:06 mikehardy

@mikehardy I'm also having trouble getting started. But in the case the difference is that I'm using the expo

My package.json

    "expo": "44.0.0"
    "react": "17.0.1"
    "react-native": "0.64.3",
    "@react-native-firebase/analytics": "^14.11.1",
    "@react-native-firebase/app": "14.11.1",
    "@react-native-firebase/crashlytics": "14.11.1",

My package.json

    "expo": "44.0.0"
    "react": "17.0.1"
    "react-native": "0.64.3",
    "@react-native-firebase/analytics": "^14.11.1",
    "@react-native-firebase/app": "14.11.1",
    "@react-native-firebase/crashlytics": "14.11.1",

My app.js

{
  "expo": {
    "name": "myapp",
    "slug": "myapp",
    "version": "1.0.0",
    "jsEngine": "hermes",
    "assetBundlePatterns": [
      "**/*"
    ],
    "ios": {
      "bundleIdentifier": "org.name.myapp",
      "jsEngine": "hermes"
    },
    "splash": {
      "image": "./assets/splash.png",
      "backgroundColor": "#001D42",
      "resizeMode": "contain"
    }
  },
  "name": "myapp"
}

My PodFile

require File.join(File.dirname(`node --print "require.resolve('expo/package.json')"`), "scripts/autolinking")
require File.join(File.dirname(`node --print "require.resolve('react-native/package.json')"`), "scripts/react_native_pods")
require File.join(File.dirname(`node --print "require.resolve('@react-native-community/cli-platform-ios/package.json')"`), "native_modules")

platform :ios, '12.0'

require 'json'
podfile_properties = JSON.parse(File.read('./Podfile.properties.json')) rescue {}

target 'myapp' do
  use_frameworks!
  use_expo_modules!
  config = use_native_modules!

  use_react_native!(
    :path => config[:reactNativePath],
    :hermes_enabled => podfile_properties['expo.jsEngine'] == 'hermes'
  )

  # Uncomment to opt-in to using Flipper
  #
  # if !ENV['CI']
  #   use_flipper!('Flipper' => '0.75.1', 'Flipper-Folly' => '2.5.3', 'Flipper-RSocket' => '1.3.1')
  # end


  post_install do |installer|
    react_native_post_install(installer)

    # Workaround `Cycle inside FBReactNativeSpec` error for react-native 0.64
    # Reference: https://github.com/software-mansion/react-native-screens/issues/842#issuecomment-812543933
    installer.pods_project.targets.each do |target|
      if (target.name&.eql?('FBReactNativeSpec'))
        target.build_phases.each do |build_phase|
          if (build_phase.respond_to?(:name) && build_phase.name.eql?('[CP-User] Generate Specs'))
            target.build_phases.move(build_phase, 0)
          end
        end
      end
    end
  end

  post_integrate do |installer|
    begin
      expo_patch_react_imports!(installer)
    rescue => e
      Pod::UI.warn e
    end
    begin
      expo_patch_react_imports!(installer)
    rescue => e
      Pod::UI.warn e
    end
    begin
      expo_patch_react_imports!(installer)
    rescue => e
      Pod::UI.warn e
    end
    begin
      expo_patch_react_imports!(installer)
    rescue => e
      Pod::UI.warn e
    end
  end

end

image

Do you know what could be causing this error?

igorcesarcode avatar Jun 27 '22 19:06 igorcesarcode

@igorcesarcode you are using use_frameworks! but not $RNFirebaseAsStaticFramework=true in your Podfile, that's my guess --> https://rnfirebase.io/#altering-cocoapods-to-use-frameworks

mikehardy avatar Jun 27 '22 19:06 mikehardy

@mikehardy did a couple of pod install, deintegrate, repo update, cleaning caches I was getting error with pod install so I did arch -x86_64 pod install then did a normal pod install ... I did encounter bunch of more errors so on don't know which one did the trick but today I run the script again and finally make-demo.sh runned longer than ever but in the end give this error :

▸ Compiling AppDelegate.mm
▸ Compiling rnfbdemo_vers.c
▸ Linking rnfbdemo
▸ Compiling LaunchScreen.storyboard
▸ Copying GoogleService-Info.plist
▸ Processing Info.plist
▸ Generating 'rnfbdemo.app.dSYM'
▸ Running script 'Bundle React Native code and images'
    the transform cache was reset.

❌  error: File /Users/user/Library/Developer/Xcode/DerivedData/rnfbdemo-ejqnwflkvotwlvdgrjlhvrxcpsrc/Build/Products/Release-iphonesimulator/rnfbdemo.app/main.jsbundle does not exist. This must be a bug with


error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening rnfbdemo.xcworkspace.
info Run CLI with --verbose flag for more details.

in metro terminal

jest-haste-map: Watchman crawl failed. Retrying once with node crawler.
  Usually this happens when watchman isn't running. Create an empty `.watchmanconfig` file in your project's root folder or initialize a git or hg repository in your project.
  Error: Watchman error: std::__1::system_error: open: /Users/user/Desktop/rnfbdemo/rnfbdemo: Operation not permitted. Make sure watchman is running for this project. See https://facebook.github.io/watchman/docs/troubleshooting.
node:events:505
      throw er; // Unhandled 'error' event
      ^

Error: std::__1::system_error: open: /Users/user/Desktop/rnfbdemo/rnfbdemo: Operation not permitted
    at BunserBuf.<anonymous> (/Users/user/Desktop/rnfbdemo/rnfbdemo/node_modules/fb-watchman/index.js:95:23)
    at BunserBuf.emit (node:events:527:28)
    at BunserBuf.process (/Users/user/Desktop/rnfbdemo/rnfbdemo/node_modules/bser/index.js:292:10)
    at /Users/user/Desktop/rnfbdemo/rnfbdemo/node_modules/bser/index.js:247:12
    at process.processTicksAndRejections (node:internal/process/task_queues:77:11)
Emitted 'error' event on WatchmanWatcher instance at:
    at Client.<anonymous> (/Users/user/Desktop/rnfbdemo/rnfbdemo/node_modules/metro/node_modules/jest-haste-map/build/watchers/WatchmanWatcher.js:150:10)
    at Client.emit (node:events:527:28)
    at BunserBuf.<anonymous> (/Users/user/Desktop/rnfbdemo/rnfbdemo/node_modules/fb-watchman/index.js:107:12)
    at BunserBuf.emit (node:events:527:28)
    at /Users/user/Desktop/rnfbdemo/rnfbdemo/node_modules/bser/index.js:249:12
    at process.processTicksAndRejections (node:internal/process/task_queues:77:11) {
  watchmanResponse: {
    error: 'std::__1::system_error: open: /Users/user/Desktop/rnfbdemo/rnfbdemo: Operation not permitted',
    version: '2022.06.06.00'
  }
}

Node.js v18.3.0
Process terminated. Press <enter> to close the window 

in IOS simulator

No bundle URL present.

Make sure you're running a packager server or have included a .jsbundle file in your application bundle.

RCTFatal
__28-[RCTCxxBridge handleError:]_block_invoke
_dispatch_call_block_and_release
_dispatch_client_callout
_dispatch_main_queue_drain
_dispatch_main_queue_callback_4CF
__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
__CFRunLoopRun
CFRunLoopRunSpecific
GSEventRunModal
-[UIApplication _run]
UIApplicationMain
main
start_sim
0x0
0x0

KubilayKerim avatar Jun 28 '22 08:06 KubilayKerim

Node.js v18.3.0

Maybe v18 doesn't work yet, unknown. I use node v16. I use it via nvm. it does appear that somehow bundle generation failed.

mike@osxvm:~ % which node
/Users/mike/.nvm/versions/node/v16.15.1/bin/node

If you try node v16 and it works, I can add verification of same to the script so it fails-fast with a prescriptive error message.

It's important to note that if you got that point your iOS build worked so you are not experiencing the problem the OP posted, as such this is sort of off-topic now. Useful to know perhaps what the failure mode is but this shows make-demo is compiling iOS correctly in your environment.

mikehardy avatar Jun 28 '22 14:06 mikehardy

I'm also facing the same issue.. fresh app and everything, core Firebase module was installed successfully but when I added Crashlythics package it failed with the same error 'FirebaseCoreExtension/FIRLibrary.h' file not found .

My Podfile is same like you've described here, except that part for post_install.

Update: After reading this, I've added Storage just to check if it'll work, and it does now. So previously, FirebaseCoreExtension wasn't installed in Pods, and now it is.

brascene avatar Jun 28 '22 15:06 brascene

@brascene that's a very interesting result! So this is the second main way this can happen, and it is great to know. For reference, you may want to include functions instead of storage if you are only including it to work around this issue - I believe functions is a lighter-weight module vs storage. Though neither is that heavy.

I believe Crashlytics is the only library here where we need that header (https://github.com/invertase/react-native-firebase/blob/main/CHANGELOG.md#bug-fixes - it's the only commit related to headers) so this should only affect people using crashlytics without using either storage or functions.

For crashlytics I think I need to add a specific Podfile dependency on FirebaseCoreExtension in order to fix this

mikehardy avatar Jun 28 '22 16:06 mikehardy