FG
📱 Mobile & Cross-Platform

Command PhaseScriptExecution failed with a nonzero exit code - Error when Archive on Xcode 14.3

Freshabout 21 hours ago
Mar 14, 20260 views
Confidence Score77%
77%

Problem

Description Hi Guys, I'm trying to perform an archive using 0.71.5 but I'm getting an error. The error occurs in Build phase "[CP] Embed Pods Frameworks", when he runs the script with: "${PODS_ROOT}/Target Support Files/Pods-MyApp/Pods-MyApp-frameworks.sh" React Native Version 0.71.5 Output of `npx react-native info` System: OS: macOS 13.3 CPU: (8) arm64 Apple M1 Memory: 79.22 MB / 16.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 16.13.1 - ~/.nvm/versions/node/v16.13.1/bin/node Yarn: 1.22.17 - ~/.nvm/versions/node/v16.13.1/bin/yarn npm: 8.1.2 - ~/.nvm/versions/node/v16.13.1/bin/npm Watchman: 2022.11.14.00 - /opt/homebrew/bin/watchman Managers: CocoaPods: 1.11.3 - /Users/leonardo.felipe/.rbenv/shims/pod SDKs: iOS SDK: Platforms: DriverKit 22.4, iOS 16.4, macOS 13.3, tvOS 16.4, watchOS 9.4 Android SDK: API Levels: 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33 Build Tools: 29.0.2, 30.0.2, 30.0.3, 31.0.0, 32.0.0, 32.1.0, 33.0.0 System Images: android-32 | Google APIs ARM 64 v8a, android-33 | Google APIs ARM 64 v8a Android NDK: 22.1.7171670 IDEs: Android Studio: 2021.2 AI-212.5712.43.2112.8609683 Xcode: 14.3/14E222b - /usr/bin/xcodebuild Languages: Java: 11.0.14.1 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 18.2.0 => 18.2.0 react-native: 0.71.5 => 0.71.5 react-native-macos: Not Found npmGlobalPackages: react-native: Not Fou

Error Output

error occurs in Build phase "[CP] Embed Pods Frameworks", when he runs the script with:

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix Archive Error in Xcode 14.3 for React Native 0.71.5

Medium Risk

The error occurs during the '[CP] Embed Pods Frameworks' build phase due to potential issues with CocoaPods integration, outdated dependencies, or incorrect configurations in the Podfile or Xcode project settings. This can happen if the Pods are not correctly installed or if there are version mismatches between the libraries.

Awaiting Verification

Be the first to verify this fix

  1. 1

    Update CocoaPods

    Ensure that CocoaPods is updated to the latest version to avoid compatibility issues with Xcode and React Native.

    bash
    sudo gem install cocoapods
  2. 2

    Clean Build Folder

    In Xcode, clean the build folder to remove any cached data that might be causing the error. This can be done by selecting 'Product' from the menu and then 'Clean Build Folder' (or use the shortcut Shift + Command + K).

  3. 3

    Reinstall Pods

    Navigate to the iOS directory of your React Native project and reinstall the pods to ensure all dependencies are correctly set up. Run the following commands:

    bash
    cd ios && pod install --repo-update
  4. 4

    Check Podfile Configuration

    Open the Podfile located in the ios directory and ensure that the platform version matches your Xcode project settings. Update it if necessary to match the iOS version you are targeting.

    ruby
    platform :ios, '13.0'
  5. 5

    Verify Build Settings

    In Xcode, check the build settings for the target and ensure that 'Build Active Architecture Only' is set to 'No' for the Release configuration. This can help avoid issues with architecture mismatches.

Validation

After performing the above steps, attempt to archive the project again in Xcode. If the error does not appear and the archive process completes successfully, the issue has been resolved. Additionally, check the Xcode logs for any remaining warnings or errors.

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

react-nativemobileiosandroidplatform:-iostool:-xcodeneeds:-triage-:mag: