Fix Xcode Sandbox rsync “Operation not permitted” Error (React Native / CocoaPods Solution)

Fix Xcode Sandbox rsync “Operation not permitted” Error (React Native / CocoaPods)



If you are building a React Native iOS app and suddenly see errors like:

Sandbox: rsync deny(1) file-read-data
Operation not permitted
PhaseScriptExecution [CP] Embed Pods Frameworks

You are not alone. This issue is very common in Xcode 15+ due to stricter sandboxing rules.

🔍 Root Cause

Xcode introduced User Script Sandboxing, which restricts scripts (like CocoaPods' framework embedding step) from accessing certain files.

During build, rsync is used to copy frameworks (e.g. React.framework), but the sandbox blocks it:

  • ❌ Cannot read framework files
  • ❌ Cannot write into app bundle

This results in the infamous Operation not permitted error.

✅ Solution (Works Instantly)

Disable User Script Sandboxing in Xcode:

  1. Open your project in Xcode
  2. Select the project (not target)
  3. Go to Build Settings
  4. Search for: User Script Sandboxing
  5. Set it to: NO

Then clean and rebuild:

Shift + Command + K

That’s it. The build should succeed immediately.

💡 Why This Works

By disabling script sandboxing, you allow CocoaPods scripts (especially Embed Pods Frameworks) to:

  • Read framework binaries
  • Copy them into the app bundle
  • Preserve code signatures

⚠️ Optional (If Issue Persists)

If you still experience issues, try:

  • Grant Full Disk Access to Xcode
  • Delete DerivedData
  • Reinstall Pods

🚀 Final Thoughts

This is not a bug in your project — it’s a mismatch between newer Xcode security policies and existing build scripts used by CocoaPods and React Native.

Until the ecosystem fully adapts, disabling User Script Sandboxing is the simplest and most reliable fix.


Hope this saves you a few hours of debugging.

❤️ Support This Blog


If this post helped you, you can support my writing with a small donation. Thank you for reading.


Comments

Popular posts from this blog

fixed: embedded-redis: Unable to run on macOS Sonoma

Copying MDC Context Map in Web Clients: A Comprehensive Guide

Reset user password for your own Ghost blog