mac-cain13 / R.swift

Strong typed, autocompleted resources like images, fonts and segues in Swift projects
MIT License
9.5k stars 764 forks source link

Let 'R' is not concurrency-safe because non-'Sendable' type '_R' may have shared mutable state #902

Closed jeannustre closed 1 month ago

jeannustre commented 3 months ago

Hi,

We're getting a build error in R.generated.swift line 10 :

Let 'R' is not concurrency-safe because non-'Sendable' type '_R' may have shared mutable state

This happens on Xcode 16 Beta 4 (Swift 6), using either R.swift 7.5.0 or 7.5.1-alpha.3.

Lumisilk commented 2 months ago

Just in case, for now you can workaround it by add this:

extension _R: @unchecked Sendable {}
tomlokhorst commented 1 month ago

Fixed in release 7.6.0

jaltreuter commented 1 month ago

In case anyone else is running into this issue even after updating, I'll note that this is fixed for me (I'm using 7.7.0) but I had to delete the contents of each of my R.generated.swift files in order to force re-generation of these files. Must be some kind of caching issue?

Edit: I see now that I have "Based on dependency analysis" checked in my build phase that runs the generation script, and the readme specifically says to uncheck that box.