1

I'm preparing the SPM package, with resources folder. When I compile it for device, it work ok and I got successful. But when I try to build to simulator, I got error: ... bundle format unrecognized, invalid, or unsuitable

What can be wrong?

  1. Tried to make Resource folder empty - no result. Package.swift
  2. defaults variants with delete DerivenData - no result.
let package = Package(
    name: "GPUVideo",
    platforms: [
           .macOS(.v10_13), .iOS(.v13),
    ],
    products: [
        .library(
            name: "GPUVideo",
            targets: ["GPUVideo"]),
    ],
    dependencies: [
    ],
    targets: [
        .target(
            name: "GPUVideo",
            dependencies: [],
            exclude: ["Metal"],
            resources: [
                .copy("Resources")
            ])
    ]
)
Bimawa
  • 3,535
  • 2
  • 25
  • 45

1 Answers1

0

Solved by change: .copy on .process

resources: [
                .process("Resources")
            ])

It is unclear to me why its helps

Bimawa
  • 3,535
  • 2
  • 25
  • 45
  • It's recommended to use `.process(_:localization:)`in the doc https://developer.apple.com/documentation/packagedescription/resource/process(_:localization:) but I'm not sure about the differences. – Larme Aug 09 '22 at 16:24
  • process will perform some optimisation if possible and copy don't do this – SPatel Aug 09 '22 at 16:55
  • yes by docs copy just copying the resources. But why project not built for Simulator? – Bimawa Aug 09 '22 at 17:26