After updating my Xcode to the version 14.0, I am getting this error:
Command PhaseScriptExecution failed with a nonzero exit code
If anyone knows how to resolve it, please let me know.
After updating my Xcode to the version 14.0, I am getting this error:
Command PhaseScriptExecution failed with a nonzero exit code
If anyone knows how to resolve it, please let me know.
Search for the following line in your project, it must be in ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh
file.
source="$(readlink "${source}")"
Replace that with:
source="$(readlink -f "${source}")"
ios/Pods/Target Support Files/Pods-{app_name}/Pods-{app_name}-frameworks.sh
as opposed to Pods-Runner
. –
Robalo pod install
is going to be a headache. –
Selflove For the people facing error in cordova.
In your xcode,
Go to PODS folder :
Target Support Files => Pods-{Your Project} => Pods-{Your Project}-frameworks
Change
source="$(readlink "${source}")"
this :
source="$(readlink -f "${source}")"
Those who are facing this issue after updating your Xcode 14.2 to 14.3 (14E222b) try the below steps to run & archive app.
First upgrade your flutter version to 3.7.10 because this issue fixed in 3.7.10 (Check here)
From Xcode Runner -> PROJECT (Runner) -> Info -> Deployment Target -> iOS Deployment Target -> Set to 12.0 (Minimum)
Change
if [ -L "${source}" ]; then
echo "Symlinked..."
source="$(readlink "${source}")"
fi
with
if [ -L "${source}" ]; then
echo "Symlinked..."
source="$(readlink -f "${source}")"
fi
From your flutter Project -> ios -> Podfile
Change
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end
with
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
installer.generated_projects.each do |project|
project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'
end
end
end
end
source="$(readlink -f "${source}")"
it's working for me. –
Estonian I do not use flutter but I faced similar problem with Alamofire in my project. I didn't want to change the pod scripts as they are generated every time you install the pods. In my case the issue was fixed by updating the cocoapods to the latest and then re-generating the pods stuff:
sudo gem install cocoapods #update cocoapods to the latest
pod deintegrate
pod repo update
pod install
Don't forget to close your XCode before running these commands.
On my side this issue appeared when i change my computer and issue was caused by Apple Silicon processor. When i start to use m1 pro, i did not check the installation page i directly intalled flutter via Fvm. When i check the installation page i saw there are a few steps to install flutter on Apple Slicon. And these steps fixed the issue;
sudo softwareupdate --install-rosetta --agree-to-license
This issue was fixed in an Cocoapods
update.
Just update to version >= 1.12.1
Maybe the problem is with "Run script"
Ex: I did change firebase crashlytics from "pod" to "Packeges". But I not change script. I have tried all the solutions in
"https://mcmap.net/q/89350/-xcode-10-2-1-command-phasescriptexecution-failed-with-a-nonzero-exit-code"
My solutions is change TARGETS -> Build Phases. In the script field form
"${PODS_ROOT}/FirebaseCrashlytics/run"
to
"${BUILD_DIR%/Build/*}/SourcePackages/checkouts/firebase-ios-sdk/Crashlytics/run"
In short the problem is your script, do it right
If Scrip is install builds only. U need Targets -> Build Phases -> Run Scrip -> check "For install builds only"
Ex:
APP_PATH=“${TARGET_BUILD_DIR}/${WRAPPER_NAME}”
# This script loops through the frameworks embedded in the application and
# removes unused architectures.
find “$APP_PATH” -name ‘*.framework’ -type d | while read -r FRAMEWORK
do
FRAMEWORK_EXECUTABLE_NAME=$(defaults read “$FRAMEWORK/Info.plist” CFBundleExecutable)
FRAMEWORK_EXECUTABLE_PATH=“$FRAMEWORK/$FRAMEWORK_EXECUTABLE_NAME”
echo “Executable is $FRAMEWORK_EXECUTABLE_PATH”
EXTRACTED_ARCHS=()
for ARCH in $ARCHS
do
echo “Extracting $ARCH from $FRAMEWORK_EXECUTABLE_NAME”
lipo -extract “$ARCH” “$FRAMEWORK_EXECUTABLE_PATH” -o “$FRAMEWORK_EXECUTABLE_PATH-$ARCH”
EXTRACTED_ARCHS+=(“$FRAMEWORK_EXECUTABLE_PATH-$ARCH”)
done
echo “Merging extracted architectures: ${ARCHS}”
lipo -o “$FRAMEWORK_EXECUTABLE_PATH-merged” -create “${EXTRACTED_ARCHS[@]}”
rm “${EXTRACTED_ARCHS[@]}”
echo “Replacing original executable with thinned version”
rm “$FRAMEWORK_EXECUTABLE_PATH”
mv “$FRAMEWORK_EXECUTABLE_PATH-merged” “$FRAMEWORK_EXECUTABLE_PATH”
done
"${BUILD_DIR%/Build/*}/SourcePackages/checkouts/firebase-ios-sdk/Crashlytics/run"
to "${PODS_ROOT}/FirebaseCrashlytics/run"
Still, your answer was a big help! –
Acclamation I got this error when I tried to make an archive for AppStore. In my case, I tried everything possible, but only the following actions worked.
The details of the error indicate that it is related to Firebase.
Pods/FirebaseCrashlytics/upload-symbols: No such file or directory Command PhaseScriptExecution failed with a nonzero exit code
The Mac on which I work is not on the new M chip. So the first thing I did was run xCode through Rosseta(This is important to do)
Reinstall Firebase using SPM Swift Package Manager
I hope this will help someone!
I have removed a dependency from my project but forgot to remove that import in App.js
. due to. which this issue arises. after looking carefully. to the error message notified that after removing that. dependency form App.js
project run successfully.
I was getting this issue multiple times and once I checked the available storage of my Macbook. It was full and no space left on the device.
I just cleared an unusual file and freed some storage and the error disappeared. I hope this solution works for you too.
I am using Xcode Version 15.3 and I got the same issue.
Command PhaseScriptExecution failed with a nonzero exit code
I tried many solutions but nothing worked. However, I found that my Project -> Runner -> Configurations -> Bassed on Configurations
was the reason for this error on Xcode. I changed each of my Bassed on Configurations
sets from
Changing these solved my issue.
© 2022 - 2025 — McMap. All rights reserved.