> ## Documentation Index
> Fetch the complete documentation index at: https://docs.median.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Common Xcode issues

> Fix common Xcode build errors.

## Invalidating grant \<invalid NS/CF object> failed

This error typically appears when there’s a failure in releasing or invalidating system resources, often related to macOS or iOS system calls, particularly within Core Foundation or Cocoa (NSObject) APIs. This is usually harmless and can be ignored unless it causes repeated crashes or abnormal behavior in your app.

Although this error may seem alarming, it often does not impact the functionality of your app. However, if the issue persists or leads to app crashes, you can try the following steps:

### Delete Xcode derived data

You can manually remove derived data to reset your build environment.

Run the following command in Terminal:

```bash Terminal theme={null}
rm -rf ~/Library/Developer/Xcode/DerivedData
```

### Reset simulator (if using a simulator)

* Open Simulator.
* Select **Device → Erase All Content and Settings**.

### Uninstall and reinstall Xcode

If the issue persists after following the above steps, uninstall and reinstall Xcode to ensure a fresh installation of the entire environment.

## Error: Command PhaseScriptExecution failed with a nonzero exit code

This error usually results from local dependency issues such as outdated or incompatible CocoaPods.

Follow the steps below to troubleshoot and fix this error:

### Install the latest Xcode and macOS updates

Ensure you are running the latest non-beta versions of Xcode and macOS.

### Downgrade Xcode if necessary

If the latest Xcode is not working and all other steps here aren't successful, we recommend downgrading to the most recent minor version release. These Xcode installers are available under **Additional tools** on the Xcode [Resources page](https://developer.apple.com/xcode/resources/).

### Clean Xcode build folder

Select **Product → Clean Build Folder** from the top menu.

### Delete Xcode derived data and rebuild

You can manually remove derived data to reset your build environment. Run the following command in Terminal:

```bash Terminal theme={null}
rm -rf ~/Library/Developer/Xcode/DerivedData
```

### Update CocoaPods

Outdated CocoaPods may cause compatibility issues. To update CocoaPods, run the following command:

```bash Terminal theme={null}
sudo gem install cocoapods
```

### Re-download and extract your iOS source code

If the issue persists after following the above steps, rebuild your app on the Median platform. After rebuilding:

1. Download and extract the new `ios_source.tar.gz` file.
2. Open the `.xcworkspace` file and do not open the `.xcodeproj` file.

> [!WARNING]
>
> **Open .xcworkspace, not .xcodeproj**
>
> Median uses CocoaPods (or "pods") as a dependency manager. To ensure all dependencies are correctly integrated, always open the workspace file `<yourapp>.xcworkspace` and *not* the project file `<yourapp>.xcodeproj`.

## Missing GoNativeAppConfig.h file

Ensure you are using the latest version of Xcode or at least the latest major version, which is currently Xcode 16.

If you're using an M1 Mac, try running the app on a Rosetta-based simulator. To do this, navigate to **Product → Destination → Show All Run Destinations** and select an iPhone simulator with "(Rosetta)" in its name. Additionally, you can try running the app on a physical device.

If you extracted the source code from a ZIP file in a Windows environment, be aware that Windows may remove `.h` files, which can cause issues.


## Related topics

- [iOS build & deployment](https://docs.median.co/docs/ios-build-deployment.md)
- [Clerk](https://docs.median.co/docs/clerk.md)
- [Bloomreach](https://docs.median.co/docs/bloomreach.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.