Skip to content

R.swift Fails to Generate Resources for Folders (Xcode 16 default project structure) #913

Closed
@tlacan

Description

@tlacan

Environment:

•	Xcode Version: 16.0
•	macOS Version: Sequoia 15.0
•	R.swift Version: 7.6.1

Description:

We are experiencing issues with R.swift failing to generate the expected enum values for resources when creating new projects in Xcode 16.0 on macOS Sequoia 15.0. This problem affects multiple users, including myself and others who are being trained in a similar setup.

In new projects made with Xcode 16.0 where we add images, fonts, or strings, the R.generated.swift file does not include the resource-specific enum values. Instead, it remains in a basic template state as shown below:

//
// This is a generated file, do not edit!
// Generated by R.swift, see https://github.com/mac-cain13/R.swift
//

import Foundation
import RswiftResources

private class BundleFinder {}
let R = _R(bundle: Bundle(for: BundleFinder.self))

struct _R {
  let bundle: Foundation.Bundle
  func validate() throws {

  }

  struct project {
    let developmentRegion = "en"
  }
}

(Checked from derived data result)

Behavior:
• New Projects: The issue occurs when creating new projects in Xcode 16.0.
• Existing Projects: Interestingly, the issue does not occur when opening and using projects that were created in earlier versions of Xcode.R.swift works as expected and generates all resources enums without issues.

Attempted Workarounds:
• Verified that the resources (images, fonts, and strings) are properly added to the project.
• Cleaned and rebuilt the project.
• Removed the Derived Data folder, but no relevant changes are reflected in R.generated.swift.

Additional Notes:
• We are unable to test this configuration on Xcode 15.4, as it is not compatible with macOS Sequoia 15.0.

Expected Behavior:
R.swift should generate the necessary enum values for resources such as images, fonts, and strings in new projects created in Xcode 16.0, just as it does for projects created in earlier versions.

Steps to Reproduce:

1.	Create a new project in Xcode 16.0 on macOS Sequoia 15.0.
2.	Add resources (images, fonts, strings) to the project.
3.	Run the R.swift build phase.
4.	Check the R.generated.swift file in the Derived Data directory.

Request:

Is this a known issue with Xcode 16.0 or Sequoia 15.0 compatibility? Are there any suggested workarounds or updates to R.swift that might resolve this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions