简体   繁体   English

Xcode 10 - 多个命令生成 .app

[英]Xcode 10 - Multiple commands produce .app

I have a project that I developed with Xcode 9, and after switching to Xcode 10 I get an error during build:我有一个使用 Xcode 9 开发的项目,在切换到 Xcode 10 后,在构建过程中出现错误:

error: Multiple commands produce 'SomePath/MyApp.app':错误:多个命令产生“SomePath/MyApp.app”:
1) Target 'MyApp' has create directory command with output '/SomePath/Kvitt.app' 1) 目标 'MyApp' 已创建目录命令,输出为 '/SomePath/Kvitt.app'
2) That command depends on command in Target 'MyApp': script phase “[CP] Copy Pods Resources” 2) 该命令取决于 Target 'MyApp' 中的命令:脚本阶段“[CP] Copy Pods Resources”

I had a similar issue with different project and Info.plist file, and I solved it using this answer我在不同的项目和Info.plist文件中遇到了类似的问题,我使用这个答案解决了它

However, this time the error refers to MyApp.app , and there is no such file in Copy Bundle Resources但是,这次的错误是指MyApp.app ,而Copy Bundle Resources 中并没有这样的文件

Switching to Legacy Build System makes this go away, but want to know what's causing this and how to fix it in new build system切换到Legacy Build System会使这个问题消失,但想知道是什么导致了这个问题以及如何在新的构建系统中修复它

Any ideas?有任何想法吗?

I have got the same issue : Build error in Xcode 10 "Multiple commands produce...我遇到了同样的问题:Xcode 10 中的构建错误“多个命令产生...

:-1: Multiple commands produce '/Users/m/Library/Developer/Xcode/DerivedData/FAR- 
axuthwysrkuqbcdvfglntqgbiugn/Build/Products/Debug- 
iphonesimulator/F.A.R.app/.gitkeep':
1) Target 'FAR' (project 'FAR') has copy command from '/Users/m/Desktop/Shubham 
 Code/Backup/Shubham 2018/SVN 
Codes/FAR/FAR/FAR/ThirdParty/BPStatusBarAlert/Assets/.gitkeep' to 
'/Users/m/Library/Developer/Xcode/DerivedData/FAR- 
axuthwysrkuqbcdvfglntqgbiugn/Build/Products/Debug-iphonesimulator/F.A.R.app/.gitkeep'
2) Target 'FAR' (project 'FAR') has copy command from '/Users/m/Desktop/Shubham 
Code/Backup/Shubham 2018/SVN 
Codes/FAR/FAR/FAR/ThirdParty/BPStatusBarAlert/Classes/.gitkeep' to 
'/Users/m/Library/Developer/Xcode/DerivedData/FAR- 
axuthwysrkuqbcdvfglntqgbiugn/Build/Products/Debug-iphonesimulator/F.A.R.app/.gitkeep'

This can be resolved by following below steps :这可以通过以下步骤解决:

Step 1 : Go to build Phases.第 1 步:去构建阶段。

Step 2 : Copy bundle resources and remove the .gitkeep file.第 2 步:复制捆绑资源并删除 .gitkeep 文件。

Step 3 :Build and Success.第 3 步:建立和成功。

In your case some other file will create issue, So check the file name and delete it.在您的情况下,其他一些文件会产生问题,因此请检查文件名并将其删除。

As per my investigation, issue is because of duplicacy of file.根据我的调查,问题是由于文件重复。

Happy Coding.快乐编码。

I've got the same issue.我有同样的问题。 If you are using Cocoapods, then you can solve the issue by upgrading to Cocoapods 1.5.3 from 1.4.0.如果您使用的是 Cocoapods,那么您可以通过从 1.4.0 升级到 Cocoapods 1.5.3 来解决该问题。 as suggested in this post :正如这篇文章中所建议

After that, just do pod install in the terminal.之后,只需在终端中执行pod install

I solved a similar issue by deintegrating cocoa pods and then installing it again.我通过分解可可豆荚然后再次安装它解决了类似的问题。

I also cleared the derived data, then cleaned the code before running it again.我还清除了派生数据,然后在再次运行之前清除了代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM