使用 Firebase pod 的 Xcode 12。词法或预处理器问题。使用 <angled> 包含未找到“pb.h”文件;使用“引号”代替“?

Jos*_*len 26 xcode cocoapods firebase swiftui xcode12

我刚刚下载了 Xcode 12 beta 6。我已将 firebase 安装到项目中,但出现此错误。当我用建议更正它时,它会告诉我用原件再次更正。所有“GoogleDataTransport”都会重复此错误。您可以将 Firebase 与 Xcode 12 beta 6 一起使用吗?我究竟做错了什么?谢谢

在此处输入图片说明

Pau*_*ien 48

更新到 CocoaPods 1.10,运行pod deintegratepod install.

要在较早的 CocoaPods 版本中解决此问题,请禁用CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADERgenerate Pods 项目构建设置中的选项:

在此处输入图片说明

https://github.com/firebase/firebase-ios-sdk/issues/5987https://github.com/CocoaPods/CocoaPods/issues/9902 中的更多详细信息。


lor*_*sum 21

我通过使用 cocoapods 的预发布修复了它

sudo gem install cocoapods --pre

然后进行更新

pod install --repo-update


Dan*_*man 13

我的团队不想在 cocoapods 1.10 发布之前使用它,也不想在每次pod install重新生成它时重新编辑 Pods 项目的构建设置。这个Podfile post_install 步骤成功了,归功于Léo-Paul JULIE

post_install do |installer|
  installer.pods_project.build_configurations.each do |config|
      config.build_settings['CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER'] = 'NO'
    end
end
Run Code Online (Sandbox Code Playgroud)

编辑:正如snakeoil在下面指出的那样,您还可以消除有关您不支持的不相关iOS 版本的烦人警告。但是应该为每个target配置的构建设置编辑该设置,因此在嵌套循环中。总之,我现在要做这样的事情:

post_install do |installer|
  installer.pods_project.build_configurations.each do |config|
    # Can be removed when moving to cocoapods 1.10
    config.build_settings['CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER'] = 'NO'
  end
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      # Inherit the deployment target defined in this Podfile instead, e.g. platform :ios, '11.0' at the top of this file
      config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
    end
  end
end
Run Code Online (Sandbox Code Playgroud)