❌ Undefined symbols for architecture arm64
┌─ Symbol: _OBJC_CLASS_$_RCTEventDispatcher
└─ Referenced from: __OBJC_$_CATEGORY_RCTEventDispatcher_$_Reanimated in RCTEventDispatcher+Reanimated.o
❌ ld: symbol(s) not found for architecture arm64
❌ clang: error: linker command failed with exit code 1 (use -v to see invocation)
I am encountering a build error when running eas build --platform ios
for my React Native project using Expo on VSCode. The build stops at line 3068 with the following error:
The error seems to involve the RCTEventDispatcher
symbol from the react-native-reanimated
library. Here are some details about my setup:
-
React Native version: 0.74.1
-
Stripe version: 0.37.2
-
react-native-reanimated version: 3.10.1
-
Build tool: EAS
-
Development environment: VSCode with Expo
I have tried the following steps to resolve the issue:
-
Deleted
node_modules
andyarn.lock
, then reinstalled dependencies withyarn install
. -
Ran
pod install --repo-update
in the ios directory. -
Verified build settings in the
eas.json
file to ensure correct architecture settings.
Has anyone faced a similar issue or have any suggestions on how to resolve this linker error when using Expo and VSCode? Any help would be greatly appreciated!
Here is my Podfile
:
platform :ios, '14.0'
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 'json'
podfile_properties = JSON.parse(File.read(File.join(__dir__, 'Podfile.properties.json'))) rescue {}
ENV['RCT_NEW_ARCH_ENABLED'] = podfile_properties['newArchEnabled'] == 'true' ? '1' : '0'
ENV['EX_DEV_CLIENT_NETWORK_INSPECTOR'] = podfile_properties['EX_DEV_CLIENT_NETWORK_INSPECTOR']
install! 'cocoapods', :deterministic_uuids => false
use_modular_headers!
prepare_react_native_project!
target 'SnowsProAm' do
config = use_native_modules!
use_frameworks! :linkage => :static
use_react_native!(
:path => config[:reactNativePath],
:hermes_enabled => podfile_properties['expo.jsEngine'] == nil || podfile_properties['expo.jsEngine'] == 'hermes',
:app_path => "#{Pod::Config.instance.installation_root}/..",
:privacy_file_aggregation_enabled => podfile_properties['apple.privacyManifestAggregationEnabled'] != 'false',
)
pod 'Firebase/Core'
pod 'Firebase/Auth'
pod 'Firebase/Storage'
pod 'react-native-reanimated', :path => '../node_modules/react-native-reanimated'
pod 'Stripe', '~> 23.26.0'
pod 'StripePaymentsUI', '~> 23.26.0'
pod 'StripeApplePay', '~> 23.26.0'
pod 'StripeFinancialConnections', '~> 23.26.0'
pod 'StripePaymentSheet', '~> 23.26.0'
post_install do |installer|
react_native_post_install(
installer,
config[:reactNativePath],
:mac_catalyst_enabled => false,
:ccache_enabled => podfile_properties['apple.ccacheEnabled'] == 'true',
)
installer.target_installation_results.pod_target_installation_results
.each do |pod_name, target_installation_result|
target_installation_result.resource_bundle_targets.each do |resource_bundle_target|
resource_bundle_target.build_configurations.each do |config|
config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
end
end
end
installer.pods_project.targets.each do |target|
if target.name == 'react-native-reanimated'
target.build_configurations.each do |config|
config.build_settings['USE_HERMES'] = 'YES'
end
end
end
# Exclude arm64 for simulator builds
installer.pods_project.build_configurations.each do |config|
config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64'
end
# Ensure Hermes dependencies
installer.pods_project.targets.each do |target|
if target.name == 'hermes-engine'
target.add_dependency target
end
end
end
post_integrate do |installer|
begin
expo_patch_react_imports!(installer)
rescue => e
Pod::UI.warn e
end
end
end
Solomon Snow is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.