Unable to import local XCFramework module

Our project is split up into multiple Pods with CocoaPods and I'm currently trying to convert all of our podspecs to SPM. One of our projects has XCFramework dependencies that I'm trying to include from a local source, but my project files are complaining that the modules couldn't be found when I try to import them. Is there something I'm missing here? My Package.swift file looks something like this:

Code Block
// 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: "MyPackage",
    defaultLocalization: "en_us",
    platforms: [
        .iOS(.v12),
        .watchOS(.v6),
        .macOS(.v10_15)
    ],
    products: [
        .library(
            name: "MyPackage",
            targets: [
                "MyPackage"
            ]),
    ],
    dependencies: [
    ],
    targets: [
        .target(
            name: "MyPackage",
            dependencies: [
                .byName(name: "LocalXCFramework")
            ],
            path: "Sources/"
        ),
        
        .binaryTarget(
            name: "LocalXCFramework",
            path: "Frameworks/LocalXCFramework.xcframework"
        )
        
    ]
)


In this example, if I try to import the modules from LocalXCFramework, I get an error saying it couldn't be found.

Replies

This looks like a bug to me, would you mind filing a feedback report?
Sure thing, just filed one! FB7790145
Thank you!
This is the same issue I’m having here:

https://developer.apple.com/forums/thread/651258

will watch this thread
Hi, is there any update for this issue? I'm not able to follow the feedback report since it's private. binaryTarget is still broken with local xcframeworks for me.

Any updates here? This still seems to be an issue

Is there any workaround for this issue?