6

I have a project that I developed with Xcode 9, and after switching to Xcode 10 I get an error during build:

error: Multiple commands produce 'SomePath/MyApp.app':
1) Target 'MyApp' has create directory command with output '/SomePath/Kvitt.app'
2) That command depends on command in Target 'MyApp': script phase “[CP] Copy Pods Resources”

I had a similar issue with different project and Info.plist file, and I solved it using this answer

However, this time the error refers to MyApp.app, and there is no such file in 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

Any ideas?

mag_zbc
  • 6,801
  • 14
  • 40
  • 62
  • See https://help.apple.com/xcode/mac/current/#/dev621201fb0 – Ashley Mills Sep 26 '18 at 13:22
  • And watch https://developer.apple.com/videos/play/wwdc2018/415/ – matt Sep 26 '18 at 13:24
  • 1
    Have you found any solution without switching the build system? – veradiego31 Oct 01 '18 at 15:12
  • @AshleyMills Resource you linked describes situation where two targets produce `.app` file. In my case, the workspace contains only a single target, and the workspace itself is generated by Cocoapods. The error mentions a Cocoapods script build phase, so this rather sounds like a Cocoapods bug – mag_zbc Oct 02 '18 at 20:49
  • I tried many things but just this https://stackoverflow.com/a/52451421/2238515 solved for me – Almeida Nov 04 '18 at 22:04
  • 1
    Possible duplicate of [Xcode 10 Error: Multiple commands produce for 'app' and 'appex'](https://stackoverflow.com/questions/52382667/xcode-10-error-multiple-commands-produce-for-app-and-appex) – Nick Dec 04 '18 at 02:14

3 Answers3

3

I have got the same issue : Build error in Xcode 10 "Multiple commands produce...

:-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.

Step 2 : Copy bundle resources and remove the .gitkeep file.

Step 3 :Build and Success.

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.

Shubham Narang
  • 514
  • 2
  • 14
2

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. as suggested in this post:

After that, just do pod install in the terminal.

Linus Unnebäck
  • 23,234
  • 15
  • 74
  • 89
Asp Upload
  • 171
  • 1
  • 13
1

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.

prosoitos
  • 6,679
  • 5
  • 27
  • 41
Muhammad Essa
  • 219
  • 2
  • 6