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中有一个错误。


当前回答

有时出现这个问题的原因是你有多个目标,这些目标有不同的iOS部署目标。检查你的目标(例如你的主应用目标和你的扩展)是否有相同的iOS部署目标。

其他回答

有时出现这个问题的原因是你有多个目标,这些目标有不同的iOS部署目标。检查你的目标(例如你的主应用目标和你的扩展)是否有相同的iOS部署目标。

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

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

对于cocoapods管理的依赖项目,通过提供本地podspec来排除信息来解决问题。请参考资料。以godzippa为例

Podfile pod 'Godzippa',:podspec =>“venders/ Godzippa .podspec”

厂商/ godzippa.podspec s.source_files = 'Sources/*.{h,m}'

在检查构建日志时,我注意到一个警告:

note: Using new build system
note: Planning build
note: Constructing build description
Build system information
warning: The Copy Bundle Resources build phase contains this target's Info.plist file '/Users/<redacted>/Repositories/Whitesmith/optimize-ios/Carthage/Checkouts/WSStatusBarNotification/Miscellaneous/Info.plist'. (in target 'JDStatusBarNotification')

如果这是你的情况,那就去你的目标:

构建阶段 拷贝包资源 删除info.plist。

如果你的应用程序生成了与多个.app文件相关的错误,那么从“复制bundle资源”中删除。plist文件将不起作用。

如果该错误与.app文件有关,请执行以下步骤

Select the Target. Go to Build Phases tab. Remove the items listed in Output Files Compile the code if it compiles successfully then not follow the next steps. If code does not compile successfully and Xcode may give you an error related to "Library not found". Then add the missing library in General Tab in Linked Frameworks and Libraries that Xcode mentioned in the error. Keep adding these libraries (that Xcode ask through compile errors) in Linked Frameworks and Libraries until the code compiles successfully. Hope this helps.