Thakgrandka
Thakgrandka

Reputation: 526

Needle dependency injection via build phase exception

I get a exception when trying to build my iOS application with Needle dependency injection in Xcode, i have the following command in the build phase run script:

export SOURCEKIT_LOGGING=0 && /opt/homebrew/bin/needle generate "$SRCROOT/App/Infrastructure/DependencyInjection/Generated/GeneratedCode.swift" "$SRCROOT/App/Infrastructure/DependencyInjection/Components/AppComponent.swift"

I get this error:

💩 Unknown error: Error Domain=NSCocoaErrorDomain Code=257 "The file “AppComponent.swift” couldn’t be opened because you don’t have permission to view it." UserInfo={NSFilePath=/Users/mennospijker/code/iOS/Kenteken Scanner/Kenteken Scanner/Infrastructure/DependencyInjection/Components/AppComponent.swift, NSUnderlyingError=0x600003d900f0 {Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted"}}

The file exists and the path is correct, the permissions for the file are -rw-rw-rw-@

What could be the cause for this? I can't find any information about this issue. The mac i work on is a Macbook Air M3, for reference.

Upvotes: 0

Views: 201

Answers (1)

Anton Semenov
Anton Semenov

Reputation: 11

Have the same problem in my case the reason was enable ENABLE_USER_SCRIPT_SANDBOXING (User Script Sandboxing enter image description here).

I turned off this flag and it fixed my problem

Upvotes: 1

Related Questions