Google NearbyMessages cocoapod 生成“重复输出文件”错误

Google NearbyMessages cocoapod generates “duplicate output file” error

我在 Xcode 11.2 中遇到 NearbyMessages 的问题。当我添加 pod 'NearbyMessages' 然后执行 pod install 时,当我打开 xcworkspace 时,我收到一个“重复输出文件”错误,该错误是由“[ CP]复制Pods资源”构建阶段:

warning: duplicate output file '/Users/.../DerivedData/NearbyDemo-elvzmjtrsxnstlemqnzociqoajhv/Build/Products/Debug-iphonesimulator/NearbyDemo.app/Assets.car' on task: PhaseScriptExecution [CP] Copy Pods Resources /Users/.../DerivedData/NearbyDemo-elvzmjtrsxnstlemqnzociqoajhv/Build/Intermediates.noindex/NearbyDemo.build/Debug-iphonesimulator/NearbyDemo.build/Script-EB8FCF95DAAD8AF429AAA51F.sh (in target 'NearbyDemo' from project 'NearbyDemo’)

我搜索并发现了旧问题,例如 Google Nearby Messages API Broke App Icon,它们似乎可能相关。 post 看起来它可能是资产和 NearbyMessages 相同问题的早期表现,但看起来旧的编译器可能没有发现这个错误。

在 Xcode 10.3 中,这只是一个警告:

ignoring duplicated output file: '/Users/.../DerivedData/NearbyDemo-elvzmjtrsxnstlemqnzociqoajhv/Build/Products/Debug-iphonesimulator/NearbyDemo.app/Assets.car' in shell script build phase '[CP] Copy Pods Resources'. This warning represents an extremely serious project misconfiguration and will likely cause some shell scripts in your project to be skipped entirely, leading to other build failures or missing files in the build directory. This will be a hard error in the future. (in target 'NearbyDemo’)

有没有人知道如何解决这个问题?我可以降级 Xcode,可能让这个问题在没有硬错误的情况下通过,但这不是一个非常有吸引力的解决方案。


它可能不相关,但这是我的 Podfile:

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'NearbyDemo' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!

  # Pods for NearbyDemo
  pod 'NearbyMessages'
end

我在 macOS 10.15.1 上使用 Cocoapods 1.8.4 和 Xcode 11.2 (11B52)。

我已经 post编辑了一份“iOS 的附近消息 API - 产品反馈”报告,但想知道是否有人在此期间找到了解决方法。

经过一番搜索,我找到了一个应该有助于解决此问题的解决方法。您可以通过更改 Xcode 设置以使用旧的构建系统来实现此目的。

Xcode / File / Workspace Settings / Build system / select "Legacy Build System"

如果您需要更多信息,请查看此 link - https://github.com/CocoaPods/CocoaPods/issues/8122