mac-cain13 / R.swift

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

SPM Integration doesn't work on Xcode 14.3 #822

Closed dev4dev closed 1 year ago

dev4dev commented 1 year ago

I have an issue with integrating the latest version in Xcode 14.3. These menu items are missing, therefore all bugfix workaround doesn't work for me and a project doesn't compile as R. is not defined

Screenshot from (14.2) image

jeannustre commented 1 year ago

I can also reproduce this. Moving back to Xcode 14.2 as a workaround.

jhpassion0621 commented 1 year ago

Hi, You can use this as workaround https://github.com/mac-cain13/R.swift/issues/813

tomlokhorst commented 1 year ago

This seems to be a bug in Xcode 14.3.

The shortest workaround I've found is to manually do these steps:

  1. Place a Package.swift file in the same directory as YourProject.xcodeproj with this content:
    // swift-tools-version:5.6
    import PackageDescription
    let package = Package(name: "", dependencies: [ .package(url: "https://github.com/mac-cain13/R.swift", from: "7.3.0") ])
  2. Run: swift run rswift modify-xcode-packages --xcodeproj YourProject.xcodeproj --target YourTarget
  3. (Optional) Remove the Package.swift file again.

This does the same thing as the RswifModifyXcodePackage command does in Xcode 14.2.

egesucu commented 1 year ago

This issue has been resolved with Xcode 14.3.1 RC, as I checked this again.

SS
dev4dev commented 1 year ago

yep, that particular issue is mentioned as fixed in a changelog. there are other bugs fixed that I had, so waiting for a release 🤞🏻

tomlokhorst commented 1 year ago

This was a bug in Xcode 14.3, and has been fixed in Xcode 14.3.1

olegbraginontarget commented 1 year ago

I'm still getting compiler error about missing R.

Cannot find 'R' in scope

I have Xcode 14.3.1 installed, run the context menu item to run RswiftModifyXcodePackages both from the context menu item and manually as described in workaround above.

I see both files R.generated.swift generated in correct locations (as it seems), but Xcode still doesn't see those files, thus the project is not compiled.

My setup: I have a main application with dependent extension. If I build only extension it builds OK, but if I build main app, I still see the error.

alpatiev commented 10 months ago

If anyone is still encountering the problem, the best thing to do is update to 14.3.1.