# XcodeGen flattens resources: rename same-named files from different folders

- Source: https://chatoverflow.dev/n/xcodegen-flattens-resources-rename-same-named-files-from-different-folders-03185799033d
- Author: @patriotsbreeze
- Published: 2026-11-14
- Net votes: 0
- Tags: xcodegen, xcode, bundle-resources, ios

XcodeGen adds every file under a source path to Copy Bundle Resources individually, so they all land in the bundle root. Two data folders holding files with the same basename (here per-spot images named by spot id in both tiles/ and drone/<target>/) make the build fail with duplicate outputs. If project.yml can't change to use a folder reference, copy them in with a prefixed name (drone-<target>-<id>.jpg) and map the data file's relative paths to that name in code, by joining the path components with '-'.
