Cannot delete .xcassets content or folder (even in Finder)

47 Views Asked by At

I'm participating in this year's Swift Playground Student Challenge by Apple and encountering an issue in Xcode with the .xcassets catalog. I've created some resources and stored them inside resource catalogs (.xcassets), but I am unable to move or delete any content from within Xcode AND Finder. When trying to delete or move a resource from one folder to another in Xcode, I receive the following error message: Error message when moving/deleting a resource file from within Xcode

If I try removing a resource catalog file (still within Xcode), I get this error message: Deleting a resource file from within Xcode

My first guess was that the file did not exist in my system, so I right-clicked the resource in my catalog and clicked on "Show in Finder", and (sadly), the file existed and was accessible. So, if I have access to the folder and Contents.json file from Finder, I could directly delete them from there, but I got this error message whenever I try to move or delete something inside one of the .xcassets folders inside Finder. Error message within Finder

(Sorry, my system is set to French, basically, the system can't find my file...)

I'm still new to the whole macOS system and have only developed some small applications in Xcode. But I have never used Swift Playgrounds. Could that be the issue? I remember having difficulties with .xcassets files in the past during my university's course on app development on iOS.

There are already some blogs and other posts here about the same problem (well, at least I think it is the same problem), but I couldn't find any solution. It's been two days now I've been fighting with this .xcassets catalog, folder, file, call them what you want, and couldn't find anything.

If it can help, here is my project file structure:

.
├── GreenLight.swift
├── Models
│   ├── Recordings
│   │   ├── EmotionRecording.swift
│   │   ├── RecordingType.swift
│   │   └── Recordings.swift
│   ├── Soundscape.swift
│   └── User.swift
├── Package.swift
├── README.md
├── Resources
│   ├── Assets.xcassets
│   │   ├── AppIcon.appiconset
│   │   │   └── Contents.json
│   │   ├── Contents.json
│   │   └── PlantStage
│   │       └── Contents.json
│   ├── Themes.xcassets
│   │   ├── Blue
│   │   │   ├── Contents.json
│   │   │   └── New Folder
│   │   │       └── Contents.json
│   │   ├── Contents.json
│   │   └── Green
│   │       └── Contents.json
│   └── ThemesOld.xcassets
│       ├── Action.colorset
│       │   └── Contents.json
│       ├── Blue
│       │   └── Contents.json
│       ├── Contents.json
│       ├── Error.colorset
│       │   └── Contents.json
│       ├── Green
│       │   ├── Action.colorset
│       │   │   └── Contents.json
│       │   ├── Blue
│       │   │   └── Contents.json
│       │   ├── Contents.json
│       │   ├── Error.colorset
│       │   │   └── Contents.json
│       │   ├── Highlight.colorset
│       │   │   └── Contents.json
│       │   ├── Primary.colorset
│       │   │   └── Contents.json
│       │   ├── Secondary.colorset
│       │   │   └── Contents.json
│       │   ├── Success.colorset
│       │   │   └── Contents.json
│       │   └── Warning.colorset
│       │       └── Contents.json
│       ├── Highlight.colorset
│       │   └── Contents.json
│       ├── Primary.colorset
│       │   └── Contents.json
│       ├── Secondary.colorset
│       │   └── Contents.json
│       ├── Success.colorset
│       │   └── Contents.json
│       └── Warning.colorset
│           └── Contents.json
├── Utilities
├── ViewControllers
│   └── MainViewController.swift
├── ViewModels
│   ├── GreenlightView.swift
│   ├── HomePageView.swift
│   ├── LoginView.swift
│   ├── Main.swift
│   ├── Recordings
│   │   ├── Forms
│   │   │   └── EmotionRecordingFormView.swift
│   │   ├── RecordingDetailView.swift
│   │   ├── RecordingEntriesListView.swift
│   │   └── RecordingListView.swift
│   ├── SettingsView.swift
│   └── Soundsapes
│       ├── SoundscapeCustomizationView.swift
│       └── SoundscapeListView.swift
└── Views
    ├── GlobalStatsCard.swift
    └── PlantImageView.swift

What I've done :

Here is what I've done already :

  • Close and reopen my project
  • Restart Xcode
  • Restart my computer
  • Try deleting from Finder directly
  • Check access authorization on files / folder
  • Change access authorization on files / folder

I've created multiple .xcassets catalog file for testing, this "bug" happens on everyone of them.

UPDATE 21/02/24

I've started a new project from scratch. I did not interact with the files in Finder (only from Xcode). I still encounter the same issue. Could it be a bug with git?

0

There are 0 best solutions below