Hive
Asset catalog conflicts
GitHub issue · Open
Source
tuist/tuist #7683
Updated
Jun 11, 2026
Domains
Generated projects
What happened?
The character - and _ are treated identically resulting in conflict and compilation error in TuistAssets file.
How do we reproduce it?
- Create an Images.xcassets
- Create
walkInimage set. - Create
walk-inimage set. - Create
walk_inimage set. - Observe
walkInimage 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
louwe
Jun 17, 2025
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.)