BenRW
BenRW

Reputation: 443

The document “SceneKit Scene.scn” could not be saved

I'm trying to create a SceneKit scene. I can create it, and edit it, but the moment I try to save it I get the error "The document “SceneKit Scene.scn” could not be saved.".

The document “SceneKit Scene.scn” could not be saved.

Why is Xcode failing to save .scn, all the .scn, and nothing but the .scn?

Upvotes: 7

Views: 1828

Answers (9)

Amir.n3t
Amir.n3t

Reputation: 3439

I had the same issue, I fixed my problem by a simple workaround.

You can select your objects in dae file in Xcode editor and hit command + c and create a new .scn file in Xcode and paste them using command + v there!

Upvotes: 0

ewizard
ewizard

Reputation: 2862

Its a bug, all you have to do is rename the file in Xcode in the scene editor (on the left hand side where all the files are), mine is "ship.scn" - just rename it to whatever, hit enter. Then you can save. Hit save as. Rename back to original name and save.

Upvotes: 1

RyanM
RyanM

Reputation: 380

I had a similar issue with playgrounds failing to save, and repeated messages that the file could not be unlocked. I finally solved it by enabling full disk access for Xcode under security and privacy settings.

Upvotes: 0

NelsonPunch
NelsonPunch

Reputation: 87

I had same problem but I manage to solve it. Now I can save .scn file no matter where project located. Before I solve problem I have to move my project under User's home directory in order to make it work.

kosua20 point out that "It seems that when creating or importing a .scn file it propagated the user/group and that caused the save to fail"

I create a project name Test under my another partition. When I open it and try to save it I got this message. You can see Test project is under BOOTCAMP while Macintosh HD has my OS and user home

  1. Open your Terminal and cd to parent folder which has your project and type "ls -l" then Enter to see your folder permission. In my case my Test project folder have group permission of admin, but the account I am using is in group of staff(I will show you later how you can check it). Now I need to change permission to staff instead of admin in order to make .scn file to save successful.

  1. Go to System Preferences -> Users&Groups Unlock it first then right click on user account you are using, it will pop up a menu "Advanced Options..." and click it

  1. In pop up window locate Group and next to it has a name in input field and the name is primary group your account is current in. In my case my account is in staff. So far I can just change staff to admin then .scn file can be save successful but I don't want to.

  1. Back to Terminal while you are in parent directory where it has your project then type "sudo chgrp -hR [group] [Project folder name]" then Enter. In my case I have to type "sudo chgrp -hR staff Test" (How command work see here: chgrp). In your case it depend on which group your account is current in and project folder name.

  1. After that command if successful type "ls -l" then Enter again to check permission of group. If it is group name you are after then you can open your project and modify .scn file and save again to see if it work. In my case .scn is now can be save without any problem.

Check your project's group permission and then check if account is in that group, if not then you can either change your account's primary group which I don't recommend or you can use chgrp command to make change to project folder in Terminal. After all this you still have problem then I have no idea.

Hope this help.

Upvotes: 2

Rajasekaran Gopal
Rajasekaran Gopal

Reputation: 399

had the same issue in Xcode 10.2.1. I solved it by changed the location of project or you can create a project in different location.(In my case I synced with iCloud my desktop and documents that may be a problem) now I have created project in different location.

Upvotes: 0

JeremyP
JeremyP

Reputation: 86651

I had the same issue. Changing permissions did not work. Changing the group did not work. Exporting the scene did not work. In the end I tried the solution suggested here:

https://support.apple.com/en-us/HT203538

Actually, I skipped all the way to step 7 and I haven't done steps 8 and 9 yet, but this fixed the issue for me:

diskutil resetUserPermissions / `id -u`

Just run the above in a terminal session. Note that I am logged in as an admin user. That might make a difference.

Upvotes: 3

Silvi
Silvi

Reputation: 103

Had the same issue with .scn files and Xcode 10. I solved it exporting the .scn file (File > Export... ) and adding it to the project again. Not a great solution but it works.

Upvotes: 2

kosua20
kosua20

Reputation: 36

I've had the same issue with Xcode 10.1. The project was not stored in my home directory hierarchy, and it was assigned to the admin group instead of staff. It seems that when creating or importing a .scn file it propagated the user/group and that caused the save to fail. What solved it was to make sure that the .scn file and the whole Xcode project were owned by my user and in the staff group.

Upvotes: 1

Nadya Alekseyeva
Nadya Alekseyeva

Reputation: 11

Had the same issue with scn files not being able to be saved. In my case the project was saved in another disk and moving it to the main disk resolved it.

Upvotes: 1

Related Questions