React Native从0.68升级到0.78后iOS构建报错:Undefined symbols _main
React Native 0.68.6 升级至 0.78.0 iOS构建失败求助
已严格遵循React Native Upgrade Helper的所有步骤将项目从0.68.6版本升级至0.78.0版本,yarn install与pod install均执行成功,但在Xcode中构建iOS项目时失败,报错信息如下:
ld: warning: ignoring duplicate libraries: '-lc++' ld: warning: Could not find or use auto-linked framework 'CoreAudioTypes' ld: Undefined symbols for architecture x86_64: "_main", referenced from: <initial-undefines> ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
猜测问题可能出在应用入口配置上(比如@main或AppDelegate.swift设置错误)。
环境信息
- macOS 14.7.1 (M3)
- Xcode 16.1
- CocoaPods 1.16.2
- Ruby 2.7.4p191
希望有过React Native大版本升级iOS构建问题排查经验的开发者提供帮助,如需更多配置细节可随时补充,感谢!
内容的提问来源于stack exchange,提问作者Pirun Seng
相关产品推荐
相关产品推荐

