SwiftGen icon indicating copy to clipboard operation
SwiftGen copied to clipboard

Xcode 14 beta compile error when generate xcassets

Open kientux opened this issue 3 years ago • 7 comments

It seems that release 6.6.0 come with SwiftUI support (#979) breaks compiling on Xcode 14. Xcode 14 disallows usage of @available on stored properties:

image

kientux avatar Aug 20 '22 18:08 kientux

Same error here with Xcode 14 beta 5.

groue avatar Aug 22 '22 07:08 groue

The same with Xcode 14 GM

tr1ckyf0x avatar Sep 08 '22 12:09 tr1ckyf0x

Same error. You can use custom templates(cat a swift5 templates and delete SwiftUIColor).

zeroskylian avatar Sep 13 '22 01:09 zeroskylian

Steps:

  1. In Bash run: swiftgen template cat xcassets swift5 > xcassets-custom.stencil

  2. Remove canImport(SwiftUI) parts in xcassets-custom.stencil

  3. In swiftgen.yml file make changes: xcassets: inputs: - AppName/AppSources/Assets.xcassets outputs: - templatePath: xcassets-custom.stencil output: AppName/AppGenerated/Assets.swift

PS: templateName need to templatePath in swiftgen be careful!

firattamur avatar Sep 13 '22 12:09 firattamur

Another option is to downgrade to version 6.5.1 (or earlier), which is working without issues in Xcode 14 and iOS 16.

brurend avatar Sep 13 '22 14:09 brurend

Still can't compile in Xcode 14.0.1 with SwiftGen 6.6.2

wjling avatar Oct 11 '22 04:10 wjling

This still happens on Xcode 15.3 and SwiftGen 6.6.3 @djbe Looks like we're stuck with SwiftGen 6.5.1, which is the last working version, due to https://github.com/SwiftGen/SwiftGen/pull/979

star-light-1 avatar May 02 '24 16:05 star-light-1