Why can't I delete this file from my Xcode project? - xcode

Being new to Xcode, I foolishly added "wrong_answer.mp3" via "add files to.." to my project and in the wrong place, but I cannot remove this reference from my project. I deleted the underlying file from the file system, but I cannot find in Xcode where I can remove this reference... Can someone advise how to remove this reference from my project ?
UPDATE: Yes, I have tried delete/backspace and edit menu "Delete".

Some options
Restart Xcode
Clean project, Product—>Clean
Put the file back and delete it from Xcode

Related

How do I remove multiple git source controls from my project?

I was dragging some files from an Xcode project to a new Xcode project. Then I notice on the new Xcode project. There're now 2 source controls listed, one from the first Xcode project. The delete keyword is greyed when I right click on it.
How do I remove the git reference from the first Xcode project?
Weird af. All I had to do was move the new Xcode project to any other folder. Then the extra working copy reference disappears.
Check if you have dragged also a .git subfolder: that would explain the second repo being "created/visible" after your file move operation.
Removing that extra .git subfolder in your second directory (the one created by the move) should be enough to resolve the situation.

How can I delete an Xcode workspace?

I've got an Xcode project, in an Xcode workspace. At one point, I thought I wanted a workspace, so I added one, but it turns out I'm not doing anything which can benefit from that, and I'd rather not have that extra layer of complexity.
How can I delete the workspace, so I have just a plain project again?
I found some web pages that say a workspace is just a set of pointers to projects, but there also must be pointers back from the project to the workspace. When I try deleting the .xcworkspace directory, I get build errors with the project (files in the workspace not found).
I think I figured out the trick. For project "Foo" in workspace "Bar":
Delete the Bar.xcworkspace directory
Delete the Foo.xcodeproj/project.xcworkspace/xcuserdata/myname.xcuserdatad/UserInterfaceState.xcuserstate file
In Foo.xcodeproj/project.pbxproj, delete the "PBXContainerItemProxy" section
I used this procedure for XCode 12.4, April 2021
Close XCode
Delete the main .XCWorkspace file
Delete the following files. Note the first two will come back when you restart XCOde:
project.xcodeproj/project.xcworkspace/contents.xcworkspacedata.
project.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist.
project.xcodeproj/xcuserdata/steve.xcuserdatad/xcschemes/xcschememanagement.plist

XCode 4 Unable to Open Old Projects

I just upgraded to XCode 4 and am now unable to view a number of my previous XCode 3 projects. When I launch the projects XCode opens, but it looks like this:
Any way to tell what is going wrong? Any special logs I can look at? I don't get any warnings or errors appearing!
Had the same problem, resolved:
Right click your project's .xcodeproj file -> 'Show Package Contents' -> delete project.xcworkspace . The workspace file will be automatically recreated when you open the project again.
The alternative solution is to create a new workspace (File -> New -> Workspace) and add your project to it (File -> Add Files to "New Workspace"). Essentially the same thing.
Not sure why the workspace file gets out of sync as I didn't go through any Xcode version changes, but I suspect it was related to git commits. Didn't use .gitignore.
More info on xcworkspace:
project.xcworkspace saves your workspace settings (Navigator/Debug/Utilities panes,etc) and Editor states. It's automatically created when you create a new project.
From a forum - "When you open an xcworkspace file, it opens the associated Xcode project and restores the perspective. Therefore, Xcode workspace files (.xcworkspace) can be used as a wrapper or container for an Xcode project (.xcodeproj)."
The solution was to delete the local project files and re-clone from the GIT repository. Not sure what the issue is, but it may have been related to having opened the project in XCode 4 Developer Preview.
Just cleanup old preferences files from "your_project..xcodeproj" bundle.
In file exlorer right click on "your_project..xcodeproj" -> select Show Package Contents,
and remove all files but "project.pbxproj".
Best regards.
I had the same problem with the zxing ScanTest app. Upgrading to Xcode 4.3.2 solved the issue.

.xcodeproj doesn't open in Xcode

Until this evening everything was fine. But now Xcode doesn't open .xcodeproj files.
When I start Xcode then click File->Open and then click on .xcodeproj file, the open dialog is showing me .xcodeproj file's contents instead of opening the project. I found on the web that it may be due to an old version of Xcode but I am using 3.2.4.
What format is the volume on which the projects reside ? An Xcode project is actually a bundle, that is a directory containing a project.pbxproj file (this is the only important file) and some user-specific settings files (which are not important). Make sure the project.pbxproj file is present and has appropriate permissions. Also if this is a non HFS+ volumes then that may be part of the problem.
I got same error in my project finally i founded my answer. there total two option for solve this issue.
There is need one backup of your project. you can replace your .xcodeproj with old file.
you have to create new project and than have to add All old project file in new project.

Xcode project — old files warnings

I have a lot of warnings in my Xcode project about old files that have been deleted from my project and from the project's folder.
I have tried to delete the "build" folder of the project.
Any suggestions?
Thanks!
Are you, by chance, using this project from a source code repository?
You need to remove the files from the repository as well. For instance, "svn delete ".
What sort of warnings are you seeing?
In Xcode go to the Build menu and select Clean, then try to build again. Sometimes deleting the build folder is not enough.
If you explore the project do you see any file names that are red? If so, click to select them and press Delete.

Resources