Search code examples
xcode4file-management

Trying to add files, get error message: The operation couldn't be completed. File exists


I need to replace some images in my application. As a result I deleted them from Xcode and now when I try to add them again I get this error: enter image description here

and I am sure that that file does not exist in the project because I just deleted it. Also when I try to look for that file it does not exist.


Solution

  • Try this:

    1. go to the folder were the old image was and place it there again.
    2. go to xcode and click on add files to xcode, select the old image again and add it.
    3. remove the image form xcode both its reference and physically.
    4. add the new image (you can drag and drop to xcode or use add files to xcode)

    Hope this helps