Xcode "project.xcworkspace" has been modified

Hope this is the right place to post this. I keep getting a pop-up message from Xcode: “The file “project.xcworkspace” has been modified by another application. The file is located at “/Users/…” Do you want to keep the Xcode version or use the version on disk?”

I click on “Keep the Xcode Version” but the project then fails to build, complaining that the following package products are missing:

The same thing happens even if I select “Use Version on Disk”. The only to fix this is to quit Xcode and start it again. This happens almost every day and sometimes several times a day. This seems to happen after Xcode was upgraded to Version 15+ earlier this year. It didn’t happen with previous version (although that may just be a coincidence.). Thanks for any help!

Does anyone know what the problem is and how to fix it for good? I do use Git and Github if that has any relevance. Thanks.


Welcome to the community.

If you are still using cocoapods you may want to consider using Swift Package Manager. Most third party package providers (including Firebase) now support SPM which is way more simple to use. In fact it might solve the problem you are having. I also checked on SwiftCVS and that can also be installed by SPM.

Consider looking up on the web how to install third party software packages using Swift Package Manager. There are heaps of tutorials.

SPM is accessed from the Xcode menu via File > Add Package Dependencies.

Adding packages by SPM means that you can delete Podfile, Podfile.lock, YourProjectName.xcworkspace and the folder named Pods. You then open the project via YourProjectName.xcodeproj

Chris, I’m not using cocapods. I’m using Swift Package Manager. Do you think this is a problem with the SPM?

If you are using SPM then you should be opening the project with YourProjectName.xcodeproj unless you have a combination of packages from coccoapods and from SPM. Do you have a file in the project named YourProjectName.xcworkspace? Can you provide a screenshot of your Project Navigator window on the left?

Screen shots of the project navigator and from Finder. There is a MindWorks.xcodeproj (Name of the project is MindWorks). I don’t believe I ever installed anything from cocoapods for this project. Does no one else have this problem?

Something about the file structure in Finder does not look right. There are files where they should not be. For example you should not have not have a MyPlayground.playground inside a project that you are creating for a phone App nor should the MindWorks.xcodeproj be inside the second MindWorks folder.

If you move files around in Finder rather than through Xcode you could break your project.

This is how a typical project should look in Finder:

Notice that the SwiftDataDemo folder is at the same level as the SwiftDataDemo.xcodeproj file.

Strange, I have never moved files in Finder. The extra folder may have been that I created the project inside a folder called MindWorks. I attached the screen shots of the actual error messages. The file that it complains has been modified, “project.xcworkspace” is shown as inside the MindWorks.xcodeproj. I cannot find that file using Finder, although that may or may not mean anything. The thing is that I have been working on this project for almost 2 years with the same folder structure and I never had this problem until Xcode 15. I was hoping it would go away by itself with more recent upgrades but it has had a few upgrades since and the problem remains. I’m wondering if there a problem with the Swift Package Manager. Thanks for taking the time to look at this.

That’s a bit weird if the Firebase packages have previously been working fine with the other version of Xcode.

I just wonder if something went wrong with the latest version of Xcode that was installed. It may be worth deleting Xcode and re-installing it.