Leo Yamamoto
01/15/2025, 10:04 PMFAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':shared:checkSandboxAndWriteProtection'.
> You have sandboxing for user scripts enabled.
In your Xcode project, navigate to "Build Setting",
and under "Build Options" set "User script sandboxing" (ENABLE_USER_SCRIPT_SANDBOXING) to "NO".
Then, run "./gradlew --stop" to stop the Gradle daemon
For more information, see documentation: <https://kotl.in/iq4uke>
tapchicoma
01/16/2025, 9:13 AMTimofey Solonin
01/16/2025, 10:22 AMENABLE_USER_SCRIPT_SANDBOXING
build setting to yes and prefix gradle call in the Xcode build phase with:
ENABLE_USER_SCRIPT_SANDBOXING=NO ./gradlew ...
this way the script and all child subprocesses (Gradle) will be sandboxed, but Kotlin Gradle Plugin will think it is not.
I would still highly recommend you to avoid doing this. If Gradle daemon starts in a sandboxed environment, it will be prohibited from doing certain IO. In particular we rely on being able to write files in CONFIGURATION_BUILD_DIR
which is sandboxed by Xcode.
disable user script sandboxing for my whole projectYou could extract Gradle call into a separate Xcode framework/aggregate target and disable sandboxing only for this particular target.
Timofey Solonin
01/16/2025, 10:26 AMCONFIGURATION_BUILD_DIR
and fail the build if it is not accessible. In your build script you will have to iterate over all configured tasks and disable a task named checkSandboxAndWriteProtection
Leo Yamamoto
01/16/2025, 4:52 PM