error: Multiple commands produce '/Users/uesr/Library/Developer/Xcode/DerivedData/OptimalLive-fxatvygbofczeyhjsawtebkimvwx/Build/Products/Debug-iphoneos/OptimalLive.app/Info.plist': 1) Target 'OptimalLive' has copy command from '/Users/uesr/Desktop/workSpace/SEALIVE/SeaLive1.1/OptimalLive/Info.plist' to '/Users/uesr/Library/Developer/Xcode/DerivedData/OptimalLive-fxatvygbofczeyhjsawtebkimvwx/Build/Products/Debug-iphoneos/OptimalLive.app/Info.plist' 2) Target 'OptimalLive' has copy command from '/Users/uesr/Desktop/workSpace/SEALIVE/SeaLive1.1/OptimalLive/Server/Masonry/Info.plist' to '/Users/uesr/Library/Developer/Xcode/DerivedData/OptimalLive-fxatvygbofczeyhjsawtebkimvwx/Build/Products/Debug-iphoneos/OptimalLive.app/Info.plist' 3) Target 'OptimalLive' has process command with input '/Users/uesr/Desktop/workSpace/SEALIVE/SeaLive1.1/OptimalLive/Info.plist'

在Xcode 9中运行代码正常,但在Xcode 10中有一个错误。


当前回答

我的情况与Damo类似——一些产品被添加到Pods项目两次。我的Podfile的结构是:

# platform :ios, '11.0' 

def shared_pods
  use_frameworks!
  pod 'SharedPod1'
end

target 'Target1' do
  pod 'SomePod1'
  shared_pods
end

target 'Target2' do
  shared_pods
end

所有共享舱都被添加了两次。取消注释的第一行,然后pod安装解决了这个问题。

其他回答

没有遗留构建系统 如果你有这样的Podfile

def shared_pods
  pod 'X'
end

target 'A' do
  shared_pods
end

target 'B' do
  shared_pods
end

B也依赖于A然后像这样把B移到A

 target 'A' do

   shared_pods

   target 'B' do
     inherit! :search_paths
   end
 end

这里是另一个工作解决方案:(如果你使用自定义Pods)

在截图中选择侧边栏中的“Pods”作为亮点。 单击Build Phase。展开“头”部分。有3个选项,公共,私人,项目 展开Public,检查是否有重复的文件。删除它。完成了! !

这基本上意味着你有多个名为Info.plist的文件; 通常情况下没问题,但你的文件被设置为相同的目标会员。因此,修复方法是:单击每个文件并在右侧检查它们的目标成员,确保它们不重叠。

在我的例子中,构建存档错误vs Xcode10

-1: Multiple commands produce '/Users/kk/Library/Developer/Xcode/DerivedData/react_carday_app-hjahojxsbvmmiyaklrhhuqljdfwv/Build/Intermediates.noindex/ArchiveIntermediates/react_carday_app/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/libyoga.a': 1) Target 'yoga' has a command with output '/Users/kk/Library/Developer/Xcode/DerivedData/react_carday_app-hjahojxsbvmmiyaklrhhuqljdfwv/Build/Intermediates.noindex/ArchiveIntermediates/react_carday_app/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/libyoga.a' 2) Target 'yoga' has a command with output '/Users/kk/Library/Developer/Xcode/DerivedData/react_carday_app-hjahojxsbvmmiyaklrhhuqljdfwv/Build/Intermediates.noindex/ArchiveIntermediates/react_carday_app/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/libyoga.a'

在你的Podfile中应该有类似bellow的东西

post_install do |installer|
  installer.pods_project.targets.each do |target|
    if target.name == "React"
      target.remove_from_project
    end

    if target.name == "yoga"
      target.remove_from_project
    end
  end
end

然后运行pod install

在我的案例中,PDFGenerator正在生成一个信息。plist文件,我刚刚删除了它。