74

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.

3
  • I'd probably remove/deintegrate everything related to CocoaPods and then start the CocoaPods process over (init, etc) Commented Feb 6, 2022 at 4: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" Commented Mar 4, 2022 at 19:40
  • A "Clean Build Folder" fixed that for me Commented Aug 10, 2022 at 9:19

28 Answers 28

108

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

Sign up to request clarification or add additional context in comments.

4 Comments

I don't see any duplicate files though all the files there are unique
And what about info.plist file is it available there or not?
@SaurabhPathak do i need to delete Googleservice-info.plist ?,bcs i don't see any other info.plist file here
I had the duplicate [CP] Check Pods Manifest.lock
35

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 Comment

I my case I've got a duplicate in the Recovered references folder after git merge.
9

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

2 Comments

it's worked but why create multiple time ??
@JitendrasinhZala you found the reason why its happening? The problem is everytime pod install is done these files get regenerated, so any way you found for a permanent fix for this issue?
7

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

Comments

6

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

2 Comments

I've removed the copy of GoogleService-Info.plist but still I'm getting the same error
Thanks - this helped me out. In my case, I had two targets ("free" and "paid" variations) that I'd accidentally renamed to have the same app name for Debug builds ("MyApp-Dev").
4

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

Comments

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

Comments

2

In my case, I checked the "For install" checkbox.

In: Targets > {your_app} > Build Phases

enter image description here

1 Comment

You freaking GOAT
1

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

Comments

1

I managed to fix this by selecting "Create folder references" instead of "Create groups" when dragging and dropping a folder into the Project Hierarchy.

Screenshot

Comments

1

I have the same issues with react native when building my application. The solution to fix this is.Remove the duplicate resource. Check on the tab build Phases Copy bundle resources

1 Comment

Please describe what is the difference of your solution to the highest voted answer of @Saurabh Pathak. I can't see anything new here.
1

I had the same issue with a Flutter project and none of the other solutions worked. In my case, deleting and reconstructing the iOS folder fixed the errors.

Run in terminal:

rm -rf build ios
flutter create --platforms=ios .
cd ios
flutter pub get
pod install --repo-update
cd ..
fluttter run

Comments

1

In My case I had two [CP] Copy Pods Resources . Not files. entire group. it can happens when you merge between branches. Delete one and you are good to go.

Comments

0

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

Comments

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.

Comments

0

For all those who are facing this after resolving conflict or issues in .pbxproj file using Kin or any other tool.

like every one said check in your Build Phase but in my case instead of duplicate files in any of the phase I have duplicate phases. In the picture below I have two "[CP]Copy Pods Resources" phases removing one Fixed the issue.enter image description here

Comments

0

I ran into this attempting to get an xcframework generated for a static Rust lib used by my project.

The build error about duplicate files can be eliminated by going into Build Settings > Embed Frameworks and checking Copy only when installing (still figuring out if this will solve my larger problem of being able to actually call the code).

Comments

0

I managed to fix this issue by returning back previous project.pbxproj (from previous commit actually).

enter image description here

Comments

0

After spending some time troubleshooting, I resolved the issue by commenting out the following line in the Podfile:

# pod 'RNPermissions', :path => '../node_modules/react-native-permissions'

after this

pod install

Comments

0

This is what happened to me:

There were 2 files with the same name in different folders

Manager/Environment

Service/Environment

It was fixed by changing the name of one of the environments.

Comments

0

In my case: XCode 15

I realize that issue happened after I re-run pod install while the Xcode was open.

So I resolve it by quitting the Xcode and open it again

Hope this help 👆

Comments

0

I encountered the following error:

Multiple commands produce '/Users/chandan/Library/Developer/Xcode/DerivedData/Test-ios-jbdjhsfbsd8686sakjbkas/Build/Intermediates.noindex/Test-ios.build/Debug-iphonesimulator/test-ios-admin.build/Objects-normal/x86_64/AllUsersNetwork.stringsdata'

Here’s how I resolved it:

  1. Go to Target -> Build Phases -> Compile Sources.
  2. Look for duplicate files listed in the Compile Sources section.
  3. In my case, the file causing the issue was AllUsersNetwork.
  4. than once in the Compile Sources list.
  5. Remove the duplicate entry (you only need one instance of the file).

After doing this, clean and rebuild your project, and the error should be resolved.

enter image description here

Comments

0

In my case, the error was caused by a name conflict between my project name, GoogleSignIn, and the package for Google's sign-in, GoogleSignIn from https://github.com/google/GoogleSignIn-iOS.

I fixed this by re-creating my project with a different name, like MyGoogleSignIn.

Example of an error message

Multiple commands produce '.../Library/Developer/Xcode/DerivedData/GoogleSignIn-hjkiprrmpemeqydvmismovkamtim/Build/Intermediates.noindex/GoogleSignIn.build/Debug-iphonesimulator/GoogleSignIn.build/GoogleSignIn.DependencyMetadataFileList'

Comments

0

Coming from year 2025 where vibe coding with Cursor is up. I ran into this error when the Ai agent moved some files for me. The error is caused by the conflict in project.pbxproj. To fix, simply remove the references in XCode(delete the red filenames) and it will be fixed.

Comments

0

If you haven't find any duplicate file in the Copy Bundle Resources and getting this error after including the Notification Service Extension for push notification,
I fixed this issue by adding the below code:

Replace this below code in Podfile file:

target 'NotificationServiceExtension' do
    pod 'Firebase/Messaging'
end

to this:

target 'NotificationServiceExtension' do
    pod 'GoogleUtilities/AppDelegateSwizzler'
    pod 'GoogleUtilities/MethodSwizzler'
    pod 'GoogleUtilities/Network'
    pod 'GoogleUtilities/NSData+zlib'
    pod 'GoogleUtilities/AppDelegateSwizzler'
    pod 'GoogleUtilities/Environment'
    pod 'GoogleUtilities/Logger'
    pod 'GoogleUtilities/UserDefaults'
    pod 'GoogleUtilities/Reachability'
    pod 'Firebase/Messaging'
end

Comments

-1

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

Comments

-1

In my case, the folder name and the file name were the same, leading to this error.

Comments

-2
  1. Xcode -> Product -> Clear All Issues
  2. Xcode -> Product -> Clean Build Folder
  3. Terminal -> pod deintegrate
  4. Termineal -> pod install

will be work fine

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.