[expo-constants][iOS] build failed: PhaseScriptExecution [CP-User]\ Generate\ app.config\ for\ prebuilt\ Constants.manifest
Problem
Summary expo-constants throws 'Command PhaseScriptExecution failed with a nonzero exit code' when building iOS. Managed or bare workflow? If you have `ios/` or `android/` directories in your project, the answer is bare! bare What platform(s) does this occur on? iOS SDK Version (managed workflow only) _No response_ Environment [code block] Reproducible demo This doesn't require any code to reproduce. Just create a new project and build its iOS on XCode. - Step 1 [code block] - Step 2 [code block] - Step 3 [code block] - Step 4 In XCode, select a team for signing - Step 5 Build and wait. - Step 5 Say hi to the error: [code block]
Error Output
Error: No iOS devices available in Simulator.app
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Fix PhaseScriptExecution Error in iOS Build for Expo Constants
The error 'Command PhaseScriptExecution failed with a nonzero exit code' occurs due to the absence of available iOS devices in the Simulator.app, which is required for building the project. This can happen if the simulator is not properly set up or if there are no simulators available for the selected device type.
Awaiting Verification
Be the first to verify this fix
- 1
Check Simulator Availability
Open the Simulator app and ensure that at least one iOS simulator is available and running. If no simulators are available, create a new simulator instance.
bashopen -a Simulator - 2
Create a New Simulator
If no simulators are available, create a new simulator by navigating to the 'Devices and Simulators' window in Xcode. Click on the '+' button to add a new simulator, select a device type and iOS version.
bashxcrun simctl create 'iPhone 14' com.apple.CoreSimulator.SimRuntime.iOS-16-0 - 3
Select the Correct Simulator in Xcode
In Xcode, go to the top menu and select 'Product' > 'Destination', then choose the newly created simulator from the list to ensure it is selected for the build.
- 4
Clean Build Folder
Clean the build folder to remove any cached data that might cause issues. In Xcode, select 'Product' > 'Clean Build Folder' or use the shortcut Shift + Command + K.
- 5
Rebuild the Project
Attempt to rebuild the project in Xcode by selecting 'Product' > 'Build'. Monitor the build process for any errors.
Validation
Confirm the fix worked by successfully building the project in Xcode without encountering the PhaseScriptExecution error. Additionally, ensure that the selected simulator is running during the build process.
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep