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:
- Open your project in Xcode
- Select the project (not target)
- Go to Build Settings
- Search for:
User Script Sandboxing - 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
Post a Comment