Multiple commands produce - CocoaPods different iOS version per target

Viewed 689

I get the following error when updating from Firebase 7.4.0 to 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”

My App (min. iOS 12.0) has a AppClip target (min. iOS 14.0).

Here's my 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
1 Answers

The best solution I found was to set the lower min target globally.

Here's the correct 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

end

Related