相关疑难解决方法(0)

生成 resource_bundle_accessor,类型 'Bundle' 没有成员 'module'

有时 Xcode 无法确定moduleBundle 中的参数。

类型“捆绑”没有成员“模块”

我的调查表明,SPM 会在名为的文件中自动为该属性生成模块扩展(有时)resource_bundle_accessor

import class Foundation.Bundle

private class BundleFinder {}

extension Foundation.Bundle {
    /// Returns the resource bundle associated with the current Swift module.
    static var module: Bundle = {
        let bundleName = "ABUIKit_ABStyleKit"

        let candidates = [
            // Bundle should be present here when the package is linked into an App.
            Bundle.main.resourceURL,

            // Bundle should be present here when the package is linked into a framework.
            Bundle(for: BundleFinder.self).resourceURL,

            // For command-line …
Run Code Online (Sandbox Code Playgroud)

xcode bundle swift swift-package-manager

22
推荐指数
3
解决办法
4273
查看次数

Swift 包管理器 - 类型“Bundle”没有成员“模块”错误

正在为框架实施 SPM,但遇到了Type 'Bundle' has no member “module”错误。

我最近在这里这里看到了另外两篇关于此的帖子,但是按照所有步骤操作,它仍然对我不起作用,没有resource_bundle_accessor生成任何文件。

在这里询问了我的 Package.swift 文件,这个问题已经得到解答和解决。为了完整起见,这里是文件:

// 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 …
Run Code Online (Sandbox Code Playgroud)

xcode swift swift-package-manager

5
推荐指数
1
解决办法
2855
查看次数

标签 统计

swift ×2

swift-package-manager ×2

xcode ×2

bundle ×1