TEAM LICENSES: Save money and learn new skills through a Hacking with Swift+ team license >>

SOLVED: GeneratedAssetSymbols.swift

Forums > SwiftUI

Updated to XCode 15.0 with a project in development. Now the compiler complains every time something like this "/...xxx.build/DerivedSources/GeneratedAssetSymbols.swift:1978:14 The "fliege2" image asset name resolves to the symbol "fliege2" which already exists. Try renaming the asset." As I have hundreds of small images in the asset cataloque (and as many complaints of the compiler), renaming them would be a pain in the a... It's a yellow warning. It comes from something that is called: GeneratedAssetSymbols.swift. I have no clue what this is, I read that ImageResource is deprecated now and that you should write a typealias like so: typealias ImageResource = KF.ImageResource. But that didn't work (I also don't know what KF is). Does someone entcounter the same problem? Does someone knows a solution? Thanks in advance

2      

GeneratedAssetSymbols.swift is generated by Xcode 15+ to give you an easy way to refer to your asset catalog assets (images, colors) using constants instead of string literals like "buttonBackgroundColor" which is easy to mess up.

SwiftGen solves this problem as well, but now Apple has added it to Xcode. This is enabled by default with the build setting Generate Asset Symbols under Asset Catalog Compiler - Options

  • If you don't have a use for this feature, you can disable this build setting.
  • If you do, but you don't want the warnings, you will have to rename assets that have overlapping names to have unique names (I tried disabling Show Notices and Show Warnings under Asset Catalog Compiler - Options and the warnings still showed up)

2      

@Wazawoo Thanks!

2      

Hacking with Swift is sponsored by Blaze.

SPONSORED Still waiting on your CI build? Speed it up ~3x with Blaze - change one line, pay less, keep your existing GitHub workflows. First 25 HWS readers to use code HACKING at checkout get 50% off the first year. Try it now for free!

Reserve your spot now

Sponsor Hacking with Swift and reach the world's largest Swift community!

Reply to this topic…

You need to create an account or log in to reply.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.