37

I have been stuck on this bug for quite a while now so any help would be appreciated. When I try to build my app I keep getting the following build error:

Multiple commands produce '/Users/my_user_name/Library/Developer/Xcode/DerivedData/Expense_Tracker_Final-aujeprcwgnjmizeaueitvhpegrzf/Build/Products/Debug-iphonesimulator/Expense Tracker Final.app':

  1. Target 'Expense Tracker Final' has create directory command with output '/Users/my_user_name/Library/Developer/Xcode/DerivedData/Expense_Tracker_Final-aujeprcwgnjmizeaueitvhpegrzf/Build/Products/Debug-iphonesimulator/Expense Tracker Final.app'
  2. That command depends on command in Target 'Expense Tracker Final': script phase “[CP] Copy Pods Resources”

I have tried solution that have been recommended on other stack overflow questions such as deleting certain files from the [CP] Copy Pods Resources, but nothing seems to be working. Could someone please help me I'm really lost.

A. G
  • 631
  • 2
  • 9
  • 19
  • I'd probably remove/deintegrate everything related to CocoaPods and then start the CocoaPods process over (init, etc) – jnpdx Feb 06 '22 at 04:48
  • Don't know who has downgraded this question and for what reason. I also keep getting this error from time to time and none of the available solutions across the stack traces has worked. The only thing which could help (sometime) is "product -> Clean Build Folder" – Akki Mar 04 '22 at 19:40
  • A "Clean Build Folder" fixed that for me – Malloc Aug 10 '22 at 09:19

11 Answers11

51

Select Targets -> BuildPhases.

There you saw Copy Bundle Resources. Just remove the duplicate file that is creating an error by selecting that file and clicking on the minus icon and if info.plist is present there just remove it also.

enter image description here

Saurabh Pathak
  • 879
  • 7
  • 10
10

In my case, this happens because there are 2 files that have the same name. So the solution is just to rename one of the files' name

  • 1
    Keep coming back to this thread thinking: "there's no duplicate, I'm sure of it!"... after a while looking at other possible issues, there's the duplicate file... – lbarbosa Jan 26 '23 at 22:53
4

Looks like there's a duplicate code in your script under Build Phase > [CP] Copy Pods Resources Remove the duplicate and re-run the project.

singhabhi13
  • 227
  • 1
  • 7
3

This error is coming from the IOS directory because there are some duplicate files Build Phase > [CP] Copy Pods Resources, in my case the project was building on Android only and throwing this error for IOS.

I fixed this by first backing up the IOS directory, then deleting the IOS directory then ran this command:

flutter create -i swift . --project-name="your project Name"

NOTE: check pubspec.yaml for your project name

A new podfile will be created, open it and uncomment this line of code platform :ios, '9.0' remember to replace the '9.0' with '10.0'

after running the command do cd . then do flutter run

3

I was having this problem while archiving the project, The above solution didn't work for me, after spending some time i finally found the solution.

  • Delete React-Core.common-AccessibilityResources in the Pods project and it worked.

steps to remove React-Core.common-AccessibilityResources

Sahil bakoru
  • 393
  • 1
  • 4
  • 10
1

My issue is fixed by removing the duplicated file (reported by the error message) in the Build Phase > Embed Frameworks.

James Ho
  • 11
  • 1
0

you have to go to build phase to make the change it worked for me, after that you delete all the copied files

0
  1. Check your pod version pod --version.

  2. Update Coacoapods to latest version - v1.5.3

  3. if it's not, by running sudo gem install -n /usr/local/bin cocoapods -v 1.5.3

  4. Update all your pods by running pod update

  5. Remove duplicate info.plist file from Target>Build Phases> Copy Bundle Resources if any.

Sahil bakoru
  • 393
  • 1
  • 4
  • 10
0

Go to Targets -> BuildPhases.

It shows which file is being duplicated, in the error message that you're shown.

For example: Multiple commands produce '/Users/.../Library/Developer/Xcode/DerivedData/Runner-ckjnwutcwrniytbresvlcsobapny/Build/Products/Debug-dev-iphoneos/Runner.app/GoogleService-Info.plist'

It's not necessarily the Info.plist file. It's GoogleService-Info.plist in this case. You can remove this file from the BuildPhases and your app will run as usual :)

0

In my case, I deleted the duplicated file in [CP] Copy Pods Resources Output Files, then it didn't show this error again.

-1

Removing the files mentioned in the error from target Build Phases>Embed Frameworks worked for me

Sjonchhe
  • 790
  • 8
  • 16