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?

6

3 Answers 3

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.

2
  • I think you shouldn't have .gitkeep in bundle resources of your application Commented May 6, 2019 at 9:10
  • 1
    Thank you... sometimes I overlook the obvious while looking for a more complex reason. Commented Oct 13, 2020 at 18: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.

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.

2
  • would be helpfull if you give the commands Commented Nov 10, 2021 at 18:18
  • First, cd to your project directory then, pod deintgerate pod install Commented Nov 15, 2021 at 9:49

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.