【问题标题】:Undefined symbols for architecture x86_64 - XCode simulator架构 x86_64 的未定义符号 - XCode 模拟器
【发布时间】:2021-11-18 03:36:38
【问题描述】:

据我所知,这个问题在一夜之间就出现了,我没有接触任何东西。每当我尝试使用 pod 运行 ""react-native run-ios --simulator" 时,我都会收到此错误:

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。

【问题讨论】:

    标签: xcode ios-simulator


    【解决方案1】:

    此问题是由于您的工作区中的 Pods 项目造成的。由于您没有指定 DEPLOYMENT_TARGET,因此您安装的每个 pod 都有不同的 set 版本。

    最简洁的方法是将下面提到的代码添加到您的可可 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
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-03-12
      • 2016-11-07
      • 2015-11-24
      • 2013-03-09
      • 2013-02-07
      • 2016-11-05
      相关资源
      最近更新 更多