Working on implementing SPM for a framework, and got stuck on the Type 'Bundle' has no member “module”
error.
I have seen two other recent posts about this here and here, but following all the steps, it is still not working for me, no resource_bundle_accessor
file is generated.
I asked about my Package.swift file here, and that has been answered and resolved. For completeness here's the file:
// swift-tools-version:5.3
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "BioSwift",
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(
name: "BioSwift",
targets: ["BioSwift"]
)
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages this package depends on.
.target(
name: "BioSwift",
dependencies: [],
resources: [
.process("Resources")
]
),
.testTarget(
name: "BioSwiftTests",
dependencies: ["BioSwift"]
)
]
)
I get the Type 'Bundle' has no member “module”
error when trying to access one of the resources in the bundle:
public let unimodURL = Bundle.module?.url(forResource: "unimod", withExtension: "xml")
The project is on GitHub here
.process("Resources")
? – Niobiumswift-tools-version:5.3
for accessing resources – Niobium