-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
I encountered the "Command PhaseScriptExecution failed with a nonzero exit code" error while trying to build my Flutter iOS project. After investigating the issue, I found a temporary solution that resolved the error, which involved making changes to the Pods-Runner-frameworks.sh file. I want to report this problem and the temporary fix I applied.
Issue:
During the build process, the PhaseScriptExecution step failed due to a problem with the Pods-Runner-frameworks.sh script. This script is responsible for embedding the frameworks from the CocoaPods dependencies into the final iOS app.
Temporary Solution:
To work around this issue, I performed the following steps:
- Located the Pods-Runner-frameworks.sh file in the ios/Pods/Target Support Files/Pods-Runner/ directory.
- Copied the Pods-Runner-frameworks.sh file into the ios/Runner/ directory.
- Made changes to the Pods-Runner-frameworks.sh file in the ios/Runner/ directory. I replaced the following line:
source="$(readlink "${source}")"
with
source="$(readlink -f "${source}")"
- Modified the project.pbxproj file in the ios/Runner.xcodeproj/ directory, updating the shellScript property for the [CP] Embed Pods Frameworks phase. I changed the line from:
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
to
shellScript = "\"${PROJECT_DIR}/Runner/Pods-Runner-frameworks.sh\"\n";
After applying these changes, the build process succeeded without any errors. However, this is only a temporary solution, and I believe it would be helpful for the Flutter team to investigate and provide a more permanent fix for this issue, taking into consideration the changes made to the Pods-Runner-frameworks.sh file.
Please let me know if you need any additional information or clarification. Thank you.