Generating resource_bundle_accessor, Type 'Bundle' has no member 'module'

前端 未结 3 921
死守一世寂寞
死守一世寂寞 2020-12-16 17:00

Some times Xcode can not determine the module parameter in the Bundle.

Type \'Bundle\' has no member \'module\'

My inve

3条回答
  •  感情败类
    2020-12-16 17:10

    Bundle.module will only be generated by SwiftPM if the resources in the Package.swift file is not empty and the specified resources actually exist.

    So there are two possible reasons why it might not work for you:

    1. You don't have any resources specified in Package.swift. Fix like this:
    .target(
        name: "MyLibrary",
        dependencies: [
            /* your dependencies */
        ],
        resources: [
            .copy("JsonData"),
            .process("Assets.xcassets"),
        ]
    ),
    
    1. The specified paths don't exist or are empty.

      Fix by checking that you've actually placed your resources inside the Sources/MyLibrary directory. A common mistake is to place them directly to Sources or to a different targets subfolder.

提交回复
热议问题