React Native项目EAS构建报错:arm64架构存在未定义符号
Expo + React Native iOS EAS构建报错:arm64架构未定义符号_RCTEventDispatcher
❌ 架构arm64存在未定义符号 ┌─ 符号: _OBJC_CLASS_$_RCTEventDispatcher └─ 引用自: RCTEventDispatcher+Reanimated.o中的__OBJC_$_CATEGORY_RCTEventDispatcher_$_Reanimated ❌ ld: 未找到适用于arm64架构的符号 ❌ clang: 错误:链接器命令执行失败,退出码1(使用-v查看调用详情)
我用VSCode配合Expo开发React Native项目,执行eas build --platform ios时触发构建错误,进程在第3068行终止,报错如上。问题看起来和react-native-reanimated库中的RCTEventDispatcher符号有关。
环境配置详情
- React Native版本: 0.74.1
- Stripe版本: 0.37.2
- react-native-reanimated版本: 3.10.1
- 构建工具: EAS
- 开发环境: VSCode + Expo
已尝试的解决步骤
- 删除
node_modules和yarn.lock,执行yarn install重新安装依赖 - 在ios目录执行
pod install --repo-update - 检查
eas.json中的构建设置,确认架构配置正确
有没有人遇到过类似问题?求提供Expo+VSCode环境下解决该链接错误的建议,万分感谢!
我的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 'SP' 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
内容的提问来源于stack exchange,提问作者Solomon Snow
相关产品推荐
相关产品推荐

