如何在没有 Xcode 10 错误的情况下将 pod FirebaseUI/Phone 添加到应用程序并将 pod FirebaseUI/Storage 添加到 iMessage 扩展?

How to add pod FirebaseUI/Phone to app & pod FirebaseUI/Storage to iMessage extension without Xcode 10 error?

在 Xcode 10.1 (10B61) 中创建空白新项目时,添加空白 "iMessage" 扩展目标,并使用 firebase 添加以下 pod 文件:

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

target 'iMessage' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  # Pods for iMessage
pod 'FirebaseUI/Storage'


end

target 'MyProject34' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  # Pods for MyProject34
pod 'FirebaseUI/Phone'

end

尝试 "Product/Archive" 时出现以下错误:

Showing Recent Messages
:-1: Multiple commands produce '/Users/huty/Library/Developer/Xcode/DerivedData/MyProject34-axmyqgtwgzajkqcujpfchvgqnoiz/Build/Intermediates.noindex/ArchiveIntermediates/MyProject34/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/GoogleUtilities.framework':
1) Target 'GoogleUtilities-Environment-Logger-UserDefaults' has create directory command with output '/Users/huty/Library/Developer/Xcode/DerivedData/MyProject34-axmyqgtwgzajkqcujpfchvgqnoiz/Build/Intermediates.noindex/ArchiveIntermediates/MyProject34/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/GoogleUtilities.framework'
2) Target 'GoogleUtilities-Environment-Logger' has create directory command with output '/Users/huty/Library/Developer/Xcode/DerivedData/MyProject34-axmyqgtwgzajkqcujpfchvgqnoiz/Build/Intermediates.noindex/ArchiveIntermediates/MyProject34/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/GoogleUtilities.framework'

Showing Recent Messages
:-1: Multiple commands produce '/Users/huty/Library/Developer/Xcode/DerivedData/MyProject34-axmyqgtwgzajkqcujpfchvgqnoiz/Build/Intermediates.noindex/ArchiveIntermediates/MyProject34/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/FirebaseUI.framework':
1) Target 'FirebaseUI-Storage' has create directory command with output '/Users/huty/Library/Developer/Xcode/DerivedData/MyProject34-axmyqgtwgzajkqcujpfchvgqnoiz/Build/Intermediates.noindex/ArchiveIntermediates/MyProject34/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/FirebaseUI.framework'
2) Target 'FirebaseUI-Auth-Phone' has create directory command with output '/Users/huty/Library/Developer/Xcode/DerivedData/MyProject34-axmyqgtwgzajkqcujpfchvgqnoiz/Build/Intermediates.noindex/ArchiveIntermediates/MyProject34/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/FirebaseUI.framework'

我应该如何解决这个问题? (我正在做的项目比较复杂,但我把错误缩小到上面的项目)

这是https://github.com/CocoaPods/CocoaPods/issues/8206 whose root cause is https://openradar.appspot.com/radar?id=5038526135533568

解决方法是 或确保所有目标都具有相同的 CocoaPod 子规范子集。在这种情况下,我相信可以通过向两个目标添加 pod GoogleUtilities/UserDefaults 来实现。