Kaveh Movahedi
Kaveh Movahedi

Reputation: 166

Firebase and Voximplant in React Native 76

I'm trying to get React Native Voximplant and Firebase to work in React Native .76 project.

The problem is and I quote from RNFirebase documentation

Fabric is partially compatible with use_frameworks!. If you enable the bridged / compatibility mode, react-native-firebase will compile correctly and be usable.

When I add use_frameworks voximplant starts throwing an error complaining react/utils/fnv1a.h file not found.

When I import Firebase pods manually like this:

pod 'Firebase', :modular_headers => true
    pod 'FirebaseCoreInternal', :modular_headers => true
    pod 'GoogleUtilities', :modular_headers => true
    pod 'FirebaseCore', :modular_headers => true
    pod 'FirebaseCoreExtension', :modular_headers => true
    pod 'FirebaseAppCheckInterop', :modular_headers => true
    pod 'FirebaseAuthInterop', :modular_headers => true
    pod 'FirebaseAuth', :modular_headers => true
    pod 'RecaptchaInterop', :modular_headers => true

that error goes away, but I get this error when building the app:
firebaseauth-swift.h file not found

I thought it might be a scope issue, I check FirebaseAuth pod, there's not header with this name.

Can anyone point me in the direction to get around this?

Upvotes: 0

Views: 104

Answers (1)

YuliaGrigorieva
YuliaGrigorieva

Reputation: 256

I recommend you update the RNFirebase and Voximplant React Native SDK to the latest versions. Voximplant has recently released Voximplant React Native SDK 1.42.1 with a fix for RN 0.76 compatibility on iOS platform.

Then, follow the RNFirebase documentation and modify Podfile file with these lines:

`use_frameworks! :linkage => :static`
$RNFirebaseAsStaticFramework = true

Complete Podfile example for RN 0.76.5

# Resolve react_native_pods.rb with node to allow for hoisting
require Pod::Executable.execute_command('node', ['-p',
  'require.resolve(
    "react-native/scripts/react_native_pods.rb",
    {paths: [process.argv[1]]},
  )', __dir__]).strip

platform :ios, min_ios_version_supported
prepare_react_native_project!

# COMMENT THESE LINES
# linkage = ENV['USE_FRAMEWORKS']
# if linkage != nil
#   Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
#   use_frameworks! :linkage => linkage.to_sym
# end

use_frameworks! :linkage => :static
$RNFirebaseAsStaticFramework = true

target 'FirebaseExample' do
  config = use_native_modules!

  use_react_native!(
    :path => config[:reactNativePath],
    # An absolute path to your application root.
    :app_path => "#{Pod::Config.instance.installation_root}/.."
  )

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

  post_install do |installer|
    # https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202
    react_native_post_install(
      installer,
      config[:reactNativePath],
      :mac_catalyst_enabled => false,
      # :ccache_enabled => true
    )
  end
end

Upvotes: 0

Related Questions