105

Xcode build Share extension error for react native.

Sandbox: bash(72986) deny(1) file-write-data /Users/XXX/ios/Pods/resources-to-copy-XXXShareExtension.txt

I have tried to rebuild many times and still get an error........

5 Answers 5

344

update your Xcode project build option 'ENABLE_USER_SCRIPT_SANDBOXING' to 'No'.

Operation path reference

Sign up to request clarification or add additional context in comments.

5 Comments

This seem to be the only solution when React native ios build script runs into perssion to read and write file issues.
It didnot work for me.
if this is already enabled, 1 - close xcode, 2 - run "rm -rf ~/Library/Developer/Xcode/DerivedData" , 3 - remove the pod causing the problem, 4 - run "pod install", 5 - add again the pod , 6 - run "pod install", 7 open the xcworkspace
This works for me as well, but is it safe? Shouldn't this setting always be enabled?
Damn Bro! What a great Fix!
50

This solution works also for ionic projects for the error: deny(1) file-read-data

update your Xcode project build option 'ENABLE_USER_SCRIPT_SANDBOXING' to 'No'.

path

2 Comments

Lifesaver. This was driving me crazy.
This worked for me. TYSM
23

Sandbox: swiftlint(33399) deny(1) file-read-data /Users/Your Name/Your Projects/Pods/SwiftLint/swiftlint - Xcode 15 Xcode 15.1

This error indicates that SwiftLint does not have permissions to read the specified file. To resolve such an error, you can follow these steps:

  • Check the file permissions in the Terminal using the following command:

ls -l /Users/Your Name/Your Projects/Pods/SwiftLint/swiftlint

If the file has limited permissions or lacks read permission, you may need to adjust the permissions.

  • Update the Sandboxing Option:

Navigate to Targets -> Project -> Build Settings -> Choose (All and Combined) -> User Script Sandboxing. Change the option from "Yes" to "No".

OR

Search 'ENABLE_USER_SCRIPT_SANDBOXING'

sandbox error

1 Comment

Find 'ENABLE_USER_SCRIPT_SANDBOXING' and set NO is easier.
3

If you are facing this CI pipeline issue with React Native recently, it is due to the Xcodeproj gem update to 1.26.0. As a patch, pin the gem version to <1.26.0 to resolve it.

1 Comment

This seems like a temporary fix, relevant issue: github.com/CocoaPods/Xcodeproj/issues/989
2

There were two User Script Sandboxing settings, one on the target and one on the app. I had to set both to No.

1 Comment

This should be a comment on the accepted answer. But it provides more information and is potentially useful to someone. If/when you have enough rep, please come back and move this to a comment.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.