Xcode does not show all folders on a SwiftPM project - xcode

I am opening a swiftPM project with Xcode. Under the Examples directory, only one subfolder is visible in Xcode, while there are 8 folders available in the Finder.
I tried to reset all Xcode settings and caches but it does not change anything.
I also try to "Add Files" or drag'n drop files to Xcode but the missing directories are not added.
Any idea why it happens and how to fix this ?
View in the Finder:
[]
View in Xcode:

Follow up for history and archives. The Examples directories having a Package.swift file do not show up in Xcode.
I guess Xcode tries to avoid package conflict. It does not handle sub-projects very well.

Related

How to display all files in Project Navigator in Xcode 9?

Some files on my Swift project, like circle.yml and .gitignore, aren't shown in the Xcode 9 Navigator. How do I get them so show up?
The Xcode project navigator is not a file browser. Just because something is in your project folder, doesn't mean the project is aware of it. The project isn't magically watching the project folder to see what's put in there. It knows about the stuff that it put in there, of course.
But you want something to be seen by the project, and you yourself put it into the project folder without telling the project that you did so, then just drag it into the project navigator to bring it to Xcode's attention. Note that you should decline Xcode's offer to make this part of the target. You don't want a .gitignore file to be built into your app; you just want the convenience of accessing it thru Xcode and the project window.

An item with the same name already exists in Xcode

I know its been asked already , but this time the solutions are not working for me .
I had some framework that was dragged to Xcode without copying it .
than i have removed it from desktop , and Xcode shows error that its missing . (till now ok).
So, i have removed the .framework of this file, from the frameworks folder in the project.
Now i can't add it again, because :
an item with the same name already exists
its not there,i can't find it in the project, and can't add it again.
What could i miss here ?
Also- Check your project folder. Sometimes your file doesn't get deleted out of that folder even though Xcode is showing that file not there.
If you go to the target settings for the target which included it, click on "Build Phases" and twirl open the section labeled "Link Binary With Libraries" you'll probably see it in the list of linked libraries. Simply select the old one and press the "-" button to remove it.
I tried all of the answers above but the only problem is that xcode doesn't delete the folder.
So make sure the folder is delete in the project directory.
If you just remove the reference of item, It's not really deleted item from your folder. You could go to the project folder and delete it.
click "remove the reference" and it's not deleted completely
Go to folder of your project and remove it.
I've been breaking my head trying to figure out this error. This happens when you delete a file/framework from your Xcode project. Then you try to read and you get that annoying error that the files already exists. Here i what i did.
I looked to make sure that the frameworks weren't in any of my group folders.
Go to build phases - link binary with Libraries. (You probably won't see your frameworks here here either).
I simply just dragged the frameworks underneath Link Binary With Libraries and it worked -____-
I didn't do anything else. Magic

How to stop Xcode from thinking files are missing

I deleted some files from my project (a pair of .m/.h).
However now every time I build Xcode warns that the files are missing (though the build is otherwise successful).
I can't see where/how Xcode thinks the files are needed, it must have some reference to them somewhere but I can't find it - the files are not listed in either the compile sources section nor the copy bundle resources section. Where else might they be listed such that Xcode feels the need to warn about them not being physically present?
To delete them try this:
create a file named like the missing one
copy this file into your project folder, so that Xcode recognizes it
right click on the file inside Xcode in the project view
select delete
select move to trash, when Xcode asks
This worked for me for files, however I have the same problem with empty folders. If somebody knows a way to get rid of the missing warning for them, please comment.
If the files are missing from the project navigator or your checkout, but not included in the build for the current target, then the build might succeed despite the warnings.
XCode's Project Navigator keeps track of files, the directory they're in, and the state in git or svn. The project warnings when opening a project are shown in the status view at the top of the window. You can review these warnings when you press command-4.
The project navigator marks files that it tracks, but that it cannot find, in red in the folder view (press command-1 for that view). If you see red file names it might be that you deleted or moved them into another folder without XCode knowing about that. Then select the red filename and delete it.
On top of this the files might be "missing from your work copy", but still present in the repository. You can do two things in the terminal to sync with or delete the file from subversion.
svn up file
svn rm --force file

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.

Resources