title: The document “SceneKit Scene.scn” could not be saved
body: <p>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.".</p>
  
  <p><a href="https://i.stack.imgur.com/8ZvwA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8ZvwA.png" alt="The document “SceneKit Scene.scn” could not be saved."></a></p>
  
  <ul>
  <li>Affects every <code>.scn</code> I try to create, regardless of project (including brand new projects with no changes other than adding this <code>.scn</code>), and does so regardless of what changes (if any) I've made to the Scene (even no changes at all gives this message)</li>
  <li>When I locate the file in Finder, <em>neither</em> the file <em>nor</em> the folder it's in are locked</li>
  <li>Project is on main disk</li>
  <li>Automatic saves also fail with the same error message</li>
  <li><code>.scn</code> file can be opened separately to the project, but again, it cannot be saved</li>
  <li>Neither the default file name nor custom file names help, regardless of whether I change the name in the sidebar after the file is created or at creation time in the New File dialog box</li>
  <li>Deleting the reference and re-adding the file doesn't help</li>
  <li>Making a copy of the file, deleing the original (in Xcode), and re-adding the copy doesn't help</li>
  <li>Cleaning the build folder doesn't help</li>
  <li>Restarting Xcode doesn't help</li>
  <li>Rebooting the mac doesn't help</li>
  <li>Issue <strong>only</strong> affects <code>.scn</code> files as far as I can see (<em>definitely doesn't</em> affect <code>.swift</code>, <code>.storyboard</code> or <code>.metal</code> files)</li>
  <li>Affects Xcode 10.0, macOS 10.14 (18A391) (Also affected previous version of macOS, but I can no longer remember which version that was)</li>
  <li>Affects Xcode 10.1, macOS 10.14.1 (18B75)</li>
  <li>Affects Xcode 10.2, macOS 10.14.4 (18E226) even worse, as it insists on saving before closing the project, but can't save, so I can only close the project or Xcode by force-quitting.</li>
  <li>Affects Xcode 10.2.1, macOS 10.14.4 (without the bug from 10.2)</li>
  <li>Affects Xcode 11.3.1, macOS 10.14.6</li>
  <li>All my files are in my home directory hierarchy</li>
  <li>Moving project folder to a different subfolder of my home directory (from ~/Documents/ to ~/Desktop/ or to ~/Downloads) has no effect</li>
  <li>All files have the same user/group, both those I can write to and the <code>.scn</code> I can't write to</li>
  <li>My user account is in the same group as the files (<code>ls -l</code> shows <code>staff</code>, as does Preferences.app > Users &amp; Groups > [right click on my account] > Advanced Options… > Group:)</li>
  <li>Exporting the .scn file (File > Export... ) and adding it to the project again doesn't help</li>
  <li>It's only Xcode which has a problem saving this file: if I open it in TextWrangler, I can modify and save it without error. Saving it in TextWrangler <em>did not</em> make it saveable in Xcode.</li>
  <li>Resetting user permissions (<code>diskutil resetUserPermissions / `id -u`</code> as suggested by @JeremyP)
  didn't help.</li>
  <li>The project is set to use git, and it doesn't help to <code>commit</code>, <code>pull</code>, or <code>push</code></li>
  </ul>
  
  <p>Why is Xcode failing  to save <code>.scn</code>, all the <code>.scn</code>, and nothing but the <code>.scn</code>?</p>