据我所知,这个问题一夜之间就出现了,我没有碰任何东西。每当我尝试运行react-native run-ios -simulator时使用pod我得到这个错误:
Undefined symbols for architecture x86_64:
"__swift_FORCE_LOAD_$_swiftDataDetection", referenced from:
__swift_FORCE_LOAD_$_swiftDataDetection_$_YogaKit in libYogaKit.a(YGLayoutExtensions.o)
(maybe you meant: __swift_FORCE_LOAD_$_swiftDataDetection_$_YogaKit)
"__swift_FORCE_LOAD_$_swiftFileProvider", referenced from:
__swift_FORCE_LOAD_$_swiftFileProvider_$_YogaKit in libYogaKit.a(YGLayoutExtensions.o)
(maybe you meant: __swift_FORCE_LOAD_$_swiftFileProvider_$_YogaKit)
ld: symbol(s) not found for architecture x86_64
我的控制台打印出一堆类似这样的东西:
/Users/me/Desktop/monorepo/client/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 15.0.99. (in target 'RNImageCropPicker' from project 'Pods')
你知道是什么引起了这个问题吗?我已经研究了几个小时了,但还是没能解决它。我目前使用的是Xcode 13.0 .
这个问题是由于工作空间中的Pods项目造成的。由于您没有指定DEPLOYMENT_TARGET,因此您安装的每个pod都有不同的集合版本。
最干净的方法是将下面提到的代码添加到您的cocoa podfile中。
platform :ios, '11.0' # Update this to set a minimum iOS DEPLOYMENT_TARGET
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
end
end
end