Posts

Post not yet marked as solved
9 Replies
6.3k Views
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: // 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.
Posted Last updated
.