Expo 48 EAS构建iOS时react-native-reanimated arm64符号未定义求助
Expo 48 + EAS构建iOS时react-native-reanimated链接错误解决方案
问题描述
升级到Expo 48后,使用EAS构建服务器(非本地)构建iOS应用失败,报错如下:
❌ Undefined symbols for architecture arm64 ┌─ Symbol: hermes::vm::NopCrashManager::~NopCrashManager() └─ Referenced from: std::__1::shared_ptr<hermes::vm::CrashManager>::shared_ptr<hermes::vm::NopCrashManager, void>(hermes::vm::NopCrashManager*) in ReanimatedRuntime.o 2631 ❌ ld: symbol(s) not found for architecture arm64 2632 ❌ clang: error: linker command failed with exit code 1 (use -v to see invocation)
已尝试在Pods、项目目标及RNReanimated Pod中排除arm64架构,问题未解决;react-native-reanimated v2.14.4可在ExpoGo运行,但v2.14.4和v3.0.2版本构建均出现相同错误。
解决步骤
1. 移除Podfile中的arm64排除配置
EAS构建服务器使用x86_64架构环境,本地M1的arm64排除规则会干扰远程构建,需删除Podfile中所有类似以下的代码:
post_install do |installer| installer.pods_project.targets.each do |target| # 移除所有EXCLUDED_ARCHS相关配置 if target.name == "RNReanimated" || target.name.match(/your-other-targets/) target.build_configurations.each do |config| config.build_settings.delete('EXCLUDED_ARCHS') config.build_settings.delete('EXCLUDED_ARCHS[sdk=iphonesimulator*]') end end end end
2. 锁定hermes-engine版本以匹配Expo 48
Expo 48依赖的React Native 0.71对应hermes-engine ~0.12.0版本,在package.json中添加或修改依赖:
"dependencies": { "hermes-engine": "~0.12.0" }
执行依赖安装:
rm -rf node_modules yarn.lock package-lock.json yarn install # 或 npm install
3. 安装Expo兼容的react-native-reanimated版本
使用Expo官方推荐的兼容版本,避免手动指定不匹配的版本:
npx expo install react-native-reanimated
4. 调整EAS构建配置
在eas.json的iOS构建配置中添加静态框架支持(Reanimated 3.x需要):
"build": { "production": { "ios": { "pods": { "useFrameworks": "static" }, "buildConfiguration": "Release" } } }
5. 清理缓存并重新构建
- 清理本地Expo缓存:
npx expo install --fix
- 清理Pod缓存并重新安装:
npx pod-install --clean
- 触发EAS构建并清理远程缓存:
eas build --platform ios --clear-cache
内容的提问来源于stack exchange,提问作者Dustin Spengler
相关产品推荐
相关产品推荐

