My project contains a Swift Package that contains a binary target. Generally, the project compiles and works properly, but the problem occurs when I try to archive the project, where I get a complier error saying No such module 'MyFramework'.
The Swift Package looks like this:
let package = Package(
name: "MyPackage",
platforms: [
.iOS(.v13)
],
products: [
.library(name: "MyPackage", targets: ["MyPackage"]),
],
dependencies: [
// Product dependencies...
],
targets: [
.binaryTarget(name: "MyFramework", path: "MyFramework.xcframework"),
.target(
name: "MyPackage",
dependencies: [
"MyFramework"
...
],
resources: [.process("Resources")]
),
.testTarget(
name: "MyPackageTests",
dependencies: ["MyPackage"])
]
)
I've tried following many solutions, among them a proposal from the Apple Developer forums where I added the framework to the products as another library and then added the framework on the app (project / client) side, which made it archive successfully, but when I tried upload the archive to the App Store I got an error saying Found an unexpected Mach-O header code: 0x72613c21.
Right now, I am trying to follow other solutions mainly on the Swift Forums but none of them seem to work for me or be clear enough.
From what I've seen, this is a Swift Bug but I am wondering if there is any workaround that is sufficient for now.
Any help will be highly appreciated. Thanks in advance!