skip to Main Content

I experience a problem where previews of SwiftUI stop working. Only the preview feature fails, I can still run the simulator.

The problem is reported as following:

Task :shared:embedAndSignAppleFrameworkForXcode FAILED

error: /Users/ … .app/Frameworks: Operation
not permitted

What went wrong:
Execution failed for task ‘:shared:embedAndSignAppleFrameworkForXcode’.
Cannot access output property ‘destDir’ of task ‘:shared:embedAndSignAppleFrameworkForXcode’. Accessing unreadable inputs or outputs is not supported. Declare the task as untracked by using Task.doNotTrackState(). For more information, please refer to https://docs.gradle.org/8.2/userguide/incremental_build.html#disable-state-tracking in the Gradle documentation.
java.nio.file.FileSystemException: /Users/ … .app/Frameworks: Operation not permitted

If I create a project everything works fine, but If I came back later this problem starts to occur.

Next day: Now the Simulator also stopped working and Xcode does not show the error details, just "Failed to create directory ‘…./Frameworks’.

2

Answers


  1. Chosen as BEST ANSWER

    The only thing working at the moment is to recreate the project. Not an elegant solution for sure, hope the problem will be fixed in one of the next updates.


  2. I spent a whole day trying to figure this one out. Thanks to @kojot’s comment above with a link to youtrack I finally got it sorted. For completeness here is the solution:

    Disable script sandboxing

    1. Select the target in Xcode.
    2. Select the Build settings tab
    3. Under Build options look for User script sandboxing and set it to No or ENABLE_USER_SCRIPT_SANDBOXING = NO;
    4. Run ./gradlew --stop in your project folder (This is the one I was missing)
    5. Build and run!
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search