首页 > 解决方案 > Xcode 12 模块 'RxSwift' 未在库演化支持下编译;使用它意味着无法保证 '' 的二进制兼容性

问题描述

一旦更新到 Xcode 12,就会出现几个警告:

模块“RxSwift”未在库演化支持下编译;使用它意味着无法保证“应用程序”的二进制兼容性

在此处输入图像描述

标签: iosswiftxcode

解决方案


您收到这些警告的原因是 podBUILD_LIBRARY_FOR_DISTRIBUTION在其构建设置中缺少标志。

将以下post_install脚本添加到您的 podfile 并确保它在您的target 'app' do块之外:

post_install do |installer|
  installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
          config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
      end
  end
end

查看以下问题了解更多详情: https ://github.com/CocoaPods/CocoaPods/issues/9232

我不会掉以轻心。请参阅以下关于 swift 论坛的讨论: https ://forums.swift.org/t/risks-of-compiler-warning-module-was-not-compiled-with-library-evolution-support/33941


推荐阅读