The question has been asked several times for previous (old) versions of XCode, but answers don’t seem to apply to XCode 16.
How to embed, in the Resources folder of an App Bundle, resources with structured folders ?
Whatever I do (e.g. Group or Folder (blue or grey) file structured in the Navigator), I still get a flat list of all resources, which of course can’t work if you have several resources with the same name (but in different folders).
Example, this will not build with XCode 16 because of the 2 resources "Marguerite.jpeg":
I even tried with an additional run script
cp -r $SRCROOT/MyResources $BUILT_PRODUCTS_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH
but the Sandbox prevents that too.
2
Answers
Here is how I worked around the problem. Clearly not ideal, but working : I used
scnassets
to build the folder structure.scnassets
can be nested and are included in the Bundle as a tree of directories. The directory names are suffixed with the extension '.scnassets', but I can live with that.If anybody has a better answer, I'll be glad to accept it.
The method is very obscure in XCode 16: