App Extension と本体アプリの両方で PINRemoteImage を使っていると Archive に失敗することがあります。
環境
- macOS 10.15.6
- Xcode12
- cocoapods 1.9.3
abstract_target 'main' do pod 'PINRemoteImage' ... target 'App' end abstract_target 'widget' do pod 'PINRemoteImage' ... target 'WidgetExtension' end
みたいな Podfile で pod install
すると↓のような frameworks が作られます。
PINRemoteImage.common-iOS
の方にだけ UIKit がリンクされて、 PINRemoteImage.common
は app extension で使える framework だけがリンクされるようです。
この状態でシミュレータでビルド実行できます。
ですが、 Archive すると Multiple commands produce ...
というようなエラーになります。どうやら PINRemoteImage.common
と PINRemoteImage.common-iOS
がテンポラリに同じ名前 PINRemoteImage.framework
の項目を作成しようとして失敗しているようです。
いろいろ試したんですが解決できず、今回は extension の方の PINRemoteImage への依存関係をなくして、 PINCache のみを使うようにして解消しました。