Whirlwind
Whirlwind

Reputation: 13665

Multiple commands produce error when doing deliver init

I am using deliver to submit application to review using fastlane...

I am getting next error:

Multiple commands produce '/Users/admin/Library/Developer/Xcode/DerivedData/fastlane-integration-ios-fhihcydqlflwnvfrgoyqgikqaugq/Build/Products/Debug-iphonesimulator/fastlane-integration-ios.app/phone_number.txt': 1) Target 'fastlane-integration-ios' (project 'fastlane-integration-ios') has copy command from '/Users/admin/Projects/fastlane-integration-ios/fastlane/metadata/review_information/phone_number.txt' to '/Users/admin/Library/Developer/Xcode/DerivedData/fastlane-integration-ios-fhihcydqlflwnvfrgoyqgikqaugq/Build/Products/Debug-iphonesimulator/fastlane-integration-ios.app/phone_number.txt' 2) Target 'fastlane-integration-ios' (project 'fastlane-integration-ios') has copy command from '/Users/admin/Projects/fastlane-integration-ios/fastlane/metadata/trade_representative_contact_information/phone_number.txt' to '/Users/admin/Library/Developer/Xcode/DerivedData/fastlane-integration-ios-fhihcydqlflwnvfrgoyqgikqaugq/Build/Products/Debug-iphonesimulator/fastlane-integration-ios.app/phone_number.txt'

This is because some files have the same name and they are added all to build phases in compile bundle resources section.

How you solve this? I mean the folder structure and all depends on deliver init command, and I guess its not possible to just rename those conflicting files.

Is there any solution for this?

Upvotes: 2

Views: 10450

Answers (2)

Energy
Energy

Reputation: 958

for me, my build phase -> copy bundle resources(pink area) was referring the file multiple times.

after I removed those files (in pink area), I can build without error.

click your project enter image description here

Upvotes: 7

balazs630
balazs630

Reputation: 3692

I would suggest to delete the files with the same name that you've added to Project >Build Phase > Copy Bundle Resources block.

Then rename these resource files with Finder to have unique name, and finally re-add them in Xcode under Copy Bundle Resources. This way you won't break the references in Xcode to your text resource files.

If you're parsing these files in code, you should update the filename paths in code, too.

Another idea:

If the files having the same name (like phone_number.txt) are holding just phone numbers in the same format, you can add a new Run Script Phase to your Build Phase and implement a shell script that merges the content of the files having the same name, and then copies the resulting file to your app's Bundle.

Upvotes: 2

Related Questions