New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SR-13773] SPM: cannot use resources with .xcodeproj #4482
Comments
@swift-ci create |
Comment by Patrick Beard (JIRA) I experienced this bug the other day and solved it a different way. I was trying to add individual .png files to my executable target, using:
When building with SPM, the Bundle.module accessor would get generated, but loading the Package.swift into Xcode 13, the accessor would not get generated. I fixed it by moving all of the image files into a subdirectory called "Resources" and switching to this form:
|
Same problem (Xcode 13A1030d, default toolchain), except none of the suggested solutions worked (didn't try xcodeproj, though). Luckily, the generated file FYI I have not a UPD: this solution didn't work in Linux (Docker, image |
Comment by Nicole Stone (JIRA) Running into this same issue on Xcode 13.2.1. Calling `swift package generate-xcodeproj` did not fix the issue for me. But doing what @kirilltitov describes by just copying the generated file into a temp file did work for me. |
Environment
macOS Catalina 10.15.7
Xcode 12.1
Additional Detail from JIRA
md5: b1fe56e5aa36f83b7e1264897fe33eab
Issue Description:
If a Swift package has a .xcodeproj file, it's not possible to use resources since the error Type 'Bundle' has no member “module” always comes up when building. It's possible to just not use a .xcodeproj file, but in some cases it's unavoidable.
For example, if you create a Swift Package which relies on UIKit, it's not possible to use `swift test` to run CLI tests.
This can solved by generating a .xcodeproj:
However adding resources to the package then ends up with the error:
Type 'Bundle' has no member 'module'
Type of expression is ambiguous without more context
The text was updated successfully, but these errors were encountered: