Xcode Archive Build Error (XABE)

After updating to the latest Xcode version, you might encounter an error while attempting to build an archive for publishing. The project itself may run without issues on the iOS simulator and real devices, but during the build archive process, you may see errors similar to this:

Error Summary:
PhaseScriptExecution [CP] Embed Pods Frameworks /Users/wawanbeneran/Library/Developer/Xcode/DerivedData/Runner-grerkoekdznimyawkheghkfzdikt/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/Runner.build/Release-iphoneos/Runner.build/Script-D8168C2EA4F1BA0F855B7FC6.sh (in target 'Runner' from project 'Runner')
...
rsync: link_stat ... failed: No such file or directory (2)
...
rsync error: some files could not be transferred (code 23)
Command PhaseScriptExecution failed with a nonzero exit code

This issue is likely due to Cocoapods compatibility with Xcode 14.3. Specifically, Xcode 14.3 now uses relative paths for framework symlinks, which Cocoapods doesn’t fully support yet.

Solution

This can be resolved by either:
  1. Waiting for Cocoapods version 1.12.1, which should address this issue.
  2. Making a small modification in your project’s script files.
Step-by-Step Fix:
  1. Navigate to Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh
  2. Modify the code by adding -f to the readlink command to resolve symlink issues with the relative paths.
Update the following code:

Before:
if [ -L "${source}" ]; then
  echo "Symlinked..."
  source="$(readlink "${source}")"
fi

After:
if [ -L "${source}" ]; then
  echo "Symlinked..."
  source="$(readlink -f "${source}")"
fi

Post a Comment

Previous Next

نموذج الاتصال