I’m migrating an existing React Native app to React Native 0.82.x. Android builds and runs fine, but iOS fails at the link step with the following error:
Undefined symbols for architecture arm64:
"facebook::react::unsafeExecuteOnMainThreadSync(std::__1::function<void ()>)", referenced from:
_RCTUnsafeExecuteOnMainQueueSync in React[118](RCTUtils.o)
RCTUnsafeExecuteOnMainQueueOnceSync(long*, void () block_pointer) in React[118](RCTUtils.o)
"facebook::react::executeSynchronouslyOnSameThread_CAN_DEADLOCK(std::__1::function<void (std::__1::function<void (facebook::jsi::Runtime&)>&&)> const&, std::__1::function<void (facebook::jsi::Runtime&)>&&)", referenced from:
facebook::react::RuntimeScheduler_Legacy::executeNowOnTheSameThread(std::__1::function<void (facebook::jsi::Runtime&)>&&) in React_runtimescheduler[5](RuntimeScheduler_Legacy.o)
facebook::react::RuntimeScheduler_Modern::executeNowOnTheSameThread(std::__1::function<void (facebook::jsi::Runtime&)>&&) in React_runtimescheduler[6](RuntimeScheduler_Modern.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
So the compiler sees the declarations (headers) for these two functions, but the linker cannot find their implementations.
Environment
- React Native: 0.82.x
- iOS: platform iOS 16
- Xcode: 26.0.1
- CocoaPods: (latest)
Firebase:
- @react-native-firebase/app
- @react-native-firebase/auth
- @react-native-firebase/crashlytics
- @react-native-firebase/firestore
- @react-native-firebase/remote-config
- @react-native-firebase/analytics
Using New Architecture (RN 0.82)
Using Hermes
Using use_frameworks! :linkage => :static (required by React Native Firebase)
Android builds without any issues.
def node_require(script)
# Resolve script with node to allow for hoisting
require Pod::Executable.execute_command('node', ['-p',
"require.resolve(
'#{script}',
{paths: [process.argv[1]]},
)", __dir__]).strip
end
node_require('react-native/scripts/react_native_pods.rb')
node_require('react-native-permissions/scripts/setup.rb')
platform :ios, '16.0'
prepare_react_native_project!
# BUNU SİL (gerek yok, RN kendi ekliyor)
# pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text', :modular_headers => true
setup_permissions([
'LocationWhenInUse',
'LocationAlways',
'Camera',
'Notifications',
'Contacts',
'PhotoLibrary',
'PhotoLibraryAddOnly',
'AppTrackingTransparency',
])
linkage = ENV['USE_FRAMEWORKS']
if linkage != nil
Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
use_frameworks! :linkage => linkage.to_sym
else
# RNFirebase dokümantasyonuna uygun zorunlu ayar
use_frameworks! :linkage => :static
end
target 'CostaCoffee' do
config = use_native_modules!
# --- ÖNEMLİ KISIM: Firebase için modular headers ---
# FirebaseAuth’ın bağımlılıkları
pod 'FirebaseAuthInterop', :modular_headers => true
pod 'FirebaseAppCheckInterop', :modular_headers => true
pod 'FirebaseCore', :modular_headers => true
pod 'FirebaseCoreExtension', :modular_headers => true
pod 'GoogleUtilities', :modular_headers => true
pod 'RecaptchaInterop', :modular_headers => true
# Diğer hata verenler
pod 'FirebaseCoreInternal', :modular_headers => true
pod 'FirebaseCrashlytics', :modular_headers => true
pod 'FirebaseFirestoreInternal', :modular_headers => true
pod 'FirebaseABTesting', :modular_headers => true
pod 'FirebaseInstallations', :modular_headers => true
pod 'GoogleDataTransport', :modular_headers => true
pod 'nanopb', :modular_headers => true
pod 'FirebaseCoreExtension', :modular_headers => true
# Eğer core’ları ayrı ayrı ekliyorsan (çoğu zaman gerek yok):
# pod 'Firebase/Core'
# pod 'Firebase/Auth'
# pod 'Firebase/Crashlytics'
# pod 'Firebase/RemoteConfig'
# pod 'Firebase/Firestore'
$RNFirebaseAsStaticFramework = true
use_react_native!(
:path => config[:reactNativePath],
:app_path => "#{Pod::Config.instance.installation_root}/..",
:fabric_enabled => true,
:hermes_enabled => true,
)
end
post_install do |installer|
react_native_post_install(
installer,
'../node_modules/react-native', # veya config[:reactNativePath]’i yukarıda global yap
:mac_catalyst_enabled => false,
)
end
Note: pod install completes successfully. I used to see the "Swift pods cannot yet be integrated as static libraries" warnings for Firebase, but adding :modular_headers => true for the dependencies fixed that. Now pod install is clean and the only problem is this linker error on Xcode.