Changing XCode project name causes fatal error

牧云@^-^@ 提交于 2019-12-24 09:27:07

问题


I am trying to rename my XCode 4 project. I have tried several different ways, but nothing works. I always get the following error:

fatal: source directory is empty,
source=Desktop/Folder/OLD PROJECT NAME.xcodeproj,
destination=Desktop/Folder/NEW PROJECT NAME.xcodeproj

What's causing this error, and how can I resolve it?


回答1:


I had a similar issue when I was trying to rename a project for the second time. The error was "fatal: bad source ...". The original project was called AppTemplate. The new project was called "Project1" (say). Project1 was created by doing a project rename (from the right bar) and subsequent steps (move main directory, change plist refs, rename scheme). When i tried to rename the new project, it complained that AppTemplate.xcodeproj/xcuserdata/.xcuserdatad/xcschemes/AppTemplate.xcscheme wasn't available. This is odd since i thought i eradicated all reference to the original project. Apparently not. My [hack] solution was to copy the original AppTemplate.xcscheme file from the original project into Project1 at the required location (Project1.xcodeproj/xcuserdata/.xcuserdatad/xcschemes/). The project rename then proceeded as normal. I know this was not your exact issue, but this is one of the few references to fatal errors on project rename on xcode.




回答2:


What worked for me was:

  1. Delete the .git folder from the project directory.
  2. Now you get a different fatal error when you rename.
  3. Go to File->Source Control->Repositories and delete the repository from the list.



回答3:


I had the same error and for me the problem was that the project I was trying to rename was not in a git repository, i.e. git saw it as a bunch of untracked files.

Adding the files to git (and committing) fixed the problem, I was able to rename the project.

It looks like Xcode 4 really wants your project files to be in a git repository.



来源:https://stackoverflow.com/questions/6819915/changing-xcode-project-name-causes-fatal-error

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!