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.".
Affects every .scn I try to create, regardless of project (including brand new projects with no changes other than adding this .scn), and does so regardless of what changes (if any) I've made to the Scene (even no changes at all gives this message)
When I locate the file in Finder, neither the file nor the folder it's in are locked
Project is on main disk
Automatic saves also fail with the same error message
.scn file can be opened separately to the project, but again, it cannot be saved
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
Deleting the reference and re-adding the file doesn't help
Making a copy of the file, deleing the original (in Xcode), and re-adding the copy doesn't help
Cleaning the build folder doesn't help
Restarting Xcode doesn't help
Rebooting the mac doesn't help
Issue only affects .scn files as far as I can see (definitely doesn't affect .swift, .storyboard or .metal files)
Affects Xcode 10.0, macOS 10.14 (18A391) (Also affected previous version of macOS, but I can no longer remember which version that was)
Affects Xcode 10.1, macOS 10.14.1 (18B75)
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.
Affects Xcode 10.2.1, macOS 10.14.4 (without the bug from 10.2)
Affects Xcode 11.3.1, macOS 10.14.6
All my files are in my home directory hierarchy
Moving project folder to a different subfolder of my home directory (from ~/Documents/ to ~/Desktop/ or to ~/Downloads) has no effect
All files have the same user/group, both those I can write to and the .scn I can't write to
My user account is in the same group as the files (ls -l shows staff, as does Preferences.app > Users & Groups > [right click on my account] > Advanced Options… > Group:)
Exporting the .scn file (File > Export... ) and adding it to the project again doesn't help
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 did not make it saveable in Xcode.
Resetting user permissions (diskutil resetUserPermissions / `id -u` as suggested by #JeremyP)
didn't help.
The project is set to use git, and it doesn't help to commit, pull, or push
Why is Xcode failing to save .scn, all the .scn, and nothing but the .scn?
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.
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.
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
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.
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
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.
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.
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.
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.
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.
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.
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.
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.
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!
Related
The above error recently started being thrown when I was making updates to an existing C# windows app that saves a folder location for files it uses.
Upon receiving this error, I found that my whole hard drive seems to be set to read only. (recently had to build a new dev system) I have tried changing the folders back to being readable via folder properties. Dialog pops up and goes through all the files as if it were changing the properties. When I open the properties immediately after, the folder is back to read only.
I have also noticed that VS IDE does't save changes to the recent files/projects.
Anyone experience this and have the solution?
Things I have tried:
created a new admin user. Logged in and found the same situation. Not tied to my profile.
Tried command prompt changing folder attributes with attrib command.
Tried changing my users permissions to full control.
uninstalled OneDrive (to eliminate possible syncing issues)
Turns out my AppData folder hidden property was set to true. Setting this folder and all sub folders to not be hidden fixes everything.
I just created a group and want to rename it but getting unable to update popup.
I know how to rename it from show in finder. but y Apple in Xcode 10.2 does not allowed it directly from Xcode?
Or
Am i missing something?
I was facing the same issue today. Only thing which helped me was quitting the Xcode and restarting it. It is working for me now
I just checked and found another way without restarting Xcode.
I have the same issue. #ravin001 i did the same thing as you and quit and restarted Xcode but i found another way.
• Go ahead and Right Click wherever you want to create the Folder/Group.
• Select New Group.
• Press Enter to name the Folder/Group whatever Xcode suggested (usually "New Group").
• Now make sure the new Folder/Group is selected and Open the inspector panel.
Inspector Panel: top most right corner.
• The little page "file inspector" should be highlighted. If not, select it.
Trying to rename it won't work, First you have to rename the folder wherever it's stored.
- To do so:
• In the inspector panel, underneath the "location" title, you should see a folder icon. Click on that folder icon.
• Xcode will open a "choose a location" folder structure widget right in the middle of the screen.
• Right Click on the "New Group" folder and Rename it to whatever you want.
• Click on the 'Choose' button to close the widget ("It's important to select choose")
Now you rename the folder to whatever you like in Xcode
NOTE
• Renaming the folder any other way other than through the "Choose a location" way, won't work and you still won't be able to edit the folder
• You'll need to do this for every folder you create. So if you just created the project and will be adding a lot of folders, then it's probably best to restart xcode
I was seeing this problem today. After further investigation I determined it was due to already having folders in that directory using the same names. This was caused by creating a Group in Xcode but reverting my git changes, which didn't revert the folder creation only the Xcode Project File changes.
Check in Finder that the folder/group names are unique.
If you just created this group and you know for sure that the name wasn't already used in this project... Make sure the folder is not open.
You do this but looking to the left side of the folder(there is a triangle/arrow) if the triangle is pointing down, this means the folder is open and Xcode won't allow you to rename the folder.
Simply press the triangle to close it (it will be pointing towards the right when closed) and try to rename again.
You shouldn't have to exit out of Xcode!!!
See next to "New Group" the arrow is pointing down
Tap on the arrow and it will point to the right
Now you are able to change the name to Controller
Let me know if this solved you issue.
i am also facing this issue. What works for me is Force Quit Xcode and restart it. Also make sure that your group should be in Right path by Right Clicking and show in Finder option.
In my case the folder was already created on the filesystem but it wasn't showing on the Project Navigator.
I only had to change the location of the "New Group" folder using the folder icon on File Inspector tab.
I think its not related to xcode, its finder problem, because directory still exists and finder doesn't show that, you can see directory exists by entering ls in terminal.
How to solve this?
Open terminal and navigate to parent directory of desired directory : cd ~/../parent or just right click parent directory and choose New Terminal at Folder
Remove desired directory : rm -rf MyGroup
Now you can try to create your group with MyGroup name.
Ok... When you create a group it also creates a folder there. If you delete the group, the folder will not be deleted. Then if you change your mind and create the group again, it will try to create the folder again. But since the folder exists, the OS will throw an error which Xcode just reports as an inability to create the group.
So just rename or delete the underlying folder and now you can rename the group. You can rearrange the files in Finder after that.
First Restart Xcode. If restart doesn't work then check that is same group name already exist inside folder. If group exist then delete it. Hope this two process will help to solve this issue.
PHPStorm thinks that my main folder, where my projects are, has "read-only" status. It says "could not save project".
The way it started was that I used a command line tool, it may have been cygwin(a linux based command line tool), or cmd or windows powershell, following a tutorial which was mac oriented. It showed how you could change permissions on folders. It was some time ago and I don't have the tutorial anymore. I don't remember the commands I made, but I only changed permissions on my project folder just to try it out.
I have then changed the permissions back on the folder so that both administrator and normal users have full access to it. But I did it by right clicking the folder and go to "security". PHPStorm still displays the read-only message and can't save the project.
I would greatly appreciate a solution!
How do I rename a project in Xcode 5?
What steps do I need to take?
In the past this was always a very tricky manual process.
Well, the answer is very very very Apple simple in Xcode 5!
In the Project Navigator on the left side, click 2 x slowly and the Project file name will be editable.
Type the new name.
A sheet will appear with a warning and will list all the items Xcode 5 believes it should change.
You can probably trust it, but you should inspect it.
The list will include the info.plist and various files, but also all the relevant strings from nib/xib files like MainMenu menus.
Accept the changes and you will get the prompt to save a snapshot of the project.
Always make a snapshot when Xcode asks, it will be useful to restore if something does not work.
Change the project name:-
Click on the target in xcode, on the right in "Identify and Type" under name change the name and press the ENTER button on your keyboard.
A window will appear confirming the change and what it will change. Once you confirm it will make the changes.
Change the root folder name:-
Go to the project directory and rename the root folder,
Open the project and u will find all the file are missing, u need to add all the files of project again
Right click the project bundle .xcodeproj file and select “Show Package Contents” from the context menu. Open the .pbxproj file with any text editor.
4>Search and replace any occurrence of the original folder name with the new folder name.
5>Save the file.
Change the Scheme name:-
rename .xscheme file
If your Project is static framework then make sure your header file has public target membership
I really recommend just opening the folder in a general editor such as Sublime Text, and doing a find/replace across the whole folder. The other methods I found were unstable, particularly when combined with .xcworkspace and cocoapods.
In Xcode 8.0, to rename your project, just go through the following instructions as described in Xcode help:
1- Select your project in the project navigator.
2- In the Identity and Type section of the File inspector, enter a new
name into the Name field.
3- Press Return.
A dialog is displayed, listing the items in your project that can be
renamed. The dialog includes a preview of how the items will appear
after the change.
4- To selectively rename items, disable the checkboxes for any items
you don’t want to rename. To rename only your app, leave the app
selected and deselect all other items.
5- Click Rename.
Source: http://help.apple.com/xcode/mac/8.0/#/dev3db3afe4f
Xcode 6 (beta 6 as of now) seems to be not very reliable with renaming projects. For me it didn't rename several of the files and groups. It also doesn't rename the physical folder the project is in. To rename my project to be sure that everything is clean I went the extra length to create a new project with the new name and copy over all the files. The assets are easy to copy but groups have to be recreated. The biggest issue with this however are CoreData data model files. Trying to simply copy this will result in a corrupt model file, even though everything looks like it is alright.
When you re-name the project name in XCode5 then info.plist entry removed from Targets --- > General ---> identity. You just need to mention it again.
In Xcode 7, renaming a project can still break your app. Make sure you backed it up before trying it.
Click on the project icon and find the project name in the inspector pane. If you change it there, Xcode will ask you if you want to rename related files. Might work. But if not, try this brute force approach:
Close Xcode
Using an advanced text editor like Sublime Text or Atom, open the
root folder. It will open the folder structure.
Perform a Global Search and Replace (it's probably cmd + shift + f), and
replace My Wrong App Name with New App. If your project name contained spaces, also search for My_Wrong_App_Name and replace
with
New_App. This changes all file contents.
Now you need to find all
the files inside the project with your old app name. Rename them
all, also the folders.
Important: Open the project file with
right click > Show Package Contents, and rename all files in there.
Reopen your Xcode project or workspace. Compile.
If you use Pods, you need to open the pods project as well and change the files in there.
Here is another great example which works well with xcode 5
I am using Xcode 4.3.2 and I am trying to add some SDK references to my project.
I can SEE the files using Finder, as I used the terminal script to view hidden files.
Yet, when I go to my user home directory in Xcode finder, it does not show the "hidden" 'Library' folder under my user profile that stores my SDK files.
Scratching head
Press and hold the ⌘ + shift and . keys at the same time.
Then you can switch to view hidden/non-hidden files.
Answering you 9 months later from OS X 10.8 Mountain Lion...
Press ⌘ShiftG from within Xcode's Open dialog -- this is the Go To Folder command from Finder. This works in XCode's Open dialog as well. You could go to 'Library' or, as I did below, go to the otherwise hidden .config directory by typing '.config'
This screenshot shows both the process & the result of opening the .config folder. Note that I've already 'gone' to the .config folder once, which is why it's displayed on the left, above Applications.
Which command are you Using ?
Use Bellow Command it worked for me.
If the Library folder is not visible in your folder, enter the command "chflags nohidden ~/Library/ " on Terminal(Applications->Utilities->Terminal) application
Had a similar problem (but arrived on this page looking for answers).
I removed a reference to a file in XCode which I actually wanted to keep but the file still existed in finder.
Even though the file is in the correct folder, Xcode won't acknowledge it until you re-add it via File > Add Files To "YourProject"
The point I'm making is that the files in your code project folders vs. those actually included in the XCode project are two different things