多个命令生成 - 每个目标的 CocoaPods 不同 iOS 版本

Multiple commands produce - CocoaPods different iOS version per target

从 Firebase 7.4.0 更新到 Firebase 7.5.0 时出现以下错误

Multiple commands produce '/Users/redacted/Library/Developer/Xcode/DerivedData/MyApp-anpbtbokxviinkeqjaakixizzscs/Build/Products/Debug-iphoneos/XCFrameworkIntermediates/FirebaseAnalytics':
1) That command depends on command in Target 'FirebaseAnalytics-iOS12.0' (project 'Pods'): script phase “[CP] Copy XCFrameworks”
2) That command depends on command in Target 'FirebaseAnalytics-iOS14.0' (project 'Pods'): script phase “[CP] Copy XCFrameworks”

我的应用程序(最小 iOS 12.0)有一个 AppClip 目标(最小 iOS 14.0)。

这是我的 Podfile

inhibit_all_warnings!
use_frameworks!

def shared_pod
  pod 'GoogleUtilities' #Or else iMessage crashes
  pod 'GTMSessionFetcher'
  pod 'Firebase/Auth'
  pod 'Firebase/RemoteConfig'
  pod 'Firebase/Core'
  pod 'Firebase/Analytics'
  pod 'Firebase/Crashlytics'
end

target 'AppClip' do
  platform :ios, '14.0'
  shared_pod
end

target 'MyApp' do
  platform :ios, '12.0'
  pod 'Firebase/Performance'
  pod 'Firebase/AdMob'
  shared_pod
end
   

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

我找到的最佳解决方案是全局设置较低的最低目标。

这是正确的Podfile

platform :ios, '12.0'
inhibit_all_warnings!
use_frameworks!


def shared_pod
  pod 'GoogleUtilities' #Or else iMessage crashes
  pod 'GTMSessionFetcher'
  pod 'Firebase/Auth'
  pod 'Firebase/RemoteConfig'
  pod 'Firebase/Core'
  pod 'Firebase/Analytics'
  pod 'Firebase/Crashlytics'
end

target 'AppClip' do
  shared_pod
end

target 'MyApp' do
  pod 'Firebase/Performance'
  pod 'Firebase/AdMob'
  shared_pod
end
   

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

结束