Xcode 10.3升级后出现Multiple commands produce错误求助
Hey there, sorry to hear you're stuck with this frustrating duplicate resource error after updating Xcode to 10.3! Let's go through some tried-and-true fixes that should resolve this issue with your gcouriers target and those duplicate [CP] Copy Pods Resources phases.
Step 1: Update CocoaPods to the Latest Stable Version
Old versions of CocoaPods often have compatibility issues with newer Xcode releases. Start by upgrading CocoaPods itself, then refresh your pods:
- Run this command in your terminal to upgrade CocoaPods:
sudo gem install cocoapods - Next, update your local pod repo and reinstall pods:
pod repo update pod install
Step 2: Remove Duplicate [CP] Copy Pods Resources Phases
Sometimes the Xcode upgrade or pod process accidentally adds duplicate resource copy scripts. Here's how to fix it:
- Open your project in Xcode, then locate the
Pods.xcodeprojin the Project Navigator. - Expand it and find the
gcourierstarget under Pods. - Go to the Build Phases tab. Look for two identical entries named
[CP] Copy Pods Resources. - Select one of them, click the minus (
-) button at the bottom of the section to delete it.
Step 3: Clean Project & Clear Caches
Cached build data can cause all sorts of weird issues. Let's wipe that:
- Press
Command + Shift + Kto clean your project's build folder. - Delete the Derived Data folder: Go to Xcode > Settings > Locations, click the arrow next to the Derived Data path, then delete the entire folder for your project.
- Re-run
pod installin your terminal.
Step 4: Reset Pods Installation (If All Else Fails)
If the above steps don't work, a full pod reset might clear up stubborn conflicts:
- Close Xcode.
- In your project directory, delete the
Podsfolder andPodfile.lockfile. - Run
pod installagain to rebuild your pods from scratch.
Step 5: Check for Manually Added Resources
Double-check your main gcouriers target's Build Phases > Copy Bundle Resources section. If you manually added files like powered-by-google-on-white.png or GooglePlaces.bundle before, CocoaPods might now also be copying them—leading to duplicates. Remove any such manually added entries if they're already managed by pods.
Why This Happens
Xcode 10.3 tightened up its resource duplication checks, while older CocoaPods versions sometimes leave duplicate copy scripts or cached configurations after an Xcode upgrade. These fixes target the most common causes of this exact error with Google-related pods and resource conflicts.
内容的提问来源于stack exchange,提问作者Daniel Tucan

