Hive Hive
Sign in

Asset catalog conflicts

GitHub issue · Open

Metadata
Source
tuist/tuist #7683
Updated
Jun 11, 2026
Domains
Generated projects
Details

What happened?

The character - and _ are treated identically resulting in conflict and compilation error in TuistAssets file.

How do we reproduce it?

  1. Create an Images.xcassets
  2. Create walkIn image set.
  3. Create walk-in image set.
  4. Create walk_in image set.
  5. Observe walkIn image asset being declared three times in the generated TuistAssets.swift file.

Error log

Invalid redeclaration of `walkIn`

macOS version

15.4

Tuist version

4.44.3

Xcode version

16.3

Comments
P
pepicrft Jun 15, 2025

HI @louwe 👋🏼. Could you include a reproducible project?

Y
YIshihara11201 Aug 27, 2025

I’d like to work on this!

Y
YIshihara11201 Aug 28, 2025

Regarding AssetsTemplate.swift at line 69, I believe the behavior of removing hyphens (-) and underscores (_) using swiftIdentifier:“pretty” is as intended.

A variable name with a hyphen would cause a compile-time error, and including an underscore goes against Swift’s guidelines, which is likely why it’s implemented this way.

For this issue, I think a valid option would be to not make any changes and leave correction to users. (Perhaps a different approach could be to log a warning message when a filename contains characters that are invalid or not recommended.)