で、具体的にCocoaPodsでどうしたらいいかというと、 どれか1つのターゲットだけにリンクするようにPodfileを構成し、その上でさらに、 platform :ios, '10.0' use_frameworks! pod 'SwiftGen' pod 'SwiftLint' pod 'LicensePlist' target 'XXXApp' do pod 'Shimmer', inhibit_warnings: true target 'XXXAppTests' do inherit! :search_paths pod 'Mockingjay', inhibit_warnings: true pod 'iOSSnapshotTestCase', inhibit_warnings: true end target 'XXXAppUITests' do inherit! :search_paths end end target 'Foo' do pod 'GoogleTagManager', inhibit_warnings: true target 'FooTests' do inherit! :search_paths pod 'Mockingjay', inhibit_warnings: true end end post_install do |installer| installer.aggregate_targets.each do |aggregate_target| puts aggregate_target.name if aggregate_target.name == 'Pods-XXXApp' aggregate_target.xcconfigs.each do |config_name, config_file| config_file.libraries.delete('GoogleAnalytics') config_file.frameworks.delete('FirebaseAnalytics') config_file.frameworks.delete('FirebaseCore') config_file.frameworks.delete('FirebaseCoreDiagnostics') config_file.frameworks.delete('FirebaseInstanceID') config_file.frameworks.delete('FirebaseNanoPB') config_file.frameworks.delete('GoogleSymbolUtilities') config_file.frameworks.delete('GoogleTagManager') config_file.frameworks.delete('GoogleToolboxForMac') config_file.frameworks.delete('GoogleUtilities') config_file.frameworks.delete('nanopb') xcconfig_path = aggregate_target.xcconfig_path(config_name) config_file.save_as(xcconfig_path) end end end end
^ 上記のように、リンクしないターゲットからはFirebaseに関連するライブラリのリンカフラグを取り除く、というのが最も分かりやすい解決法だと思います。 (edited)