Hello. My package compiles successfully but when I try to import it I get the "Module not found" error.
The purpose of the package is to bundle a set of Swift bindings for a C++ API and make it as convenient as possible for other developers to use those bindings. The package supports both macOS and iOS, and is composed of the bindings along with several xcframeworks and a set of test modules. Each xcframework encapsulates a pair of precompiled C++ dylibs, one for macOS and another for iOS.
I use Xcode to add the package to my project via File->Add Packages... And then I add the package to Targets->Frameworks, Libraries and Embedded Content. The package also includes a bridging header, which I specify in Targets->Build Settings->Swift Compiler General->Objective-C Bridging Header.
Here is my package:
// swift-tools-version:5.3
import PackageDescription
let package = Package(
name: "BrainFlow",
platforms: [
.macOS(.v10_14), .iOS(.v13)
],
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(
name: "BrainFlow",
targets: ["BoardController", "DataHandler", "MLModule", "BrainBitLib"])
],
dependencies: [
.package(name: "swift-numerics",
url: "https://github.com/apple/swift-numerics.git", .upToNextMajor(from: "1.0.0"))
],
targets: [
.target(
name: "BrainFlow",
dependencies: [.product(name: "Numerics", package: "swift-numerics")],
sources: ["BoardDescription.swift",
"BoardShim.swift",
"BrainFlowConstants.swift",
"BrainFlowException.swift",
"BrainFlowExtensions.swift",
"BrainFlowInputParams.swift",
"DataFilter.swift",
"MLModule.swift"]
),
.binaryTarget(
name: "BoardController",
path: "BoardController.xcframework"
),
.binaryTarget(
name: "DataHandler",
path: "DataHandler.xcframework"
),
.binaryTarget(
name: "MLModule",
path: "MLModule.xcframework"
),
.binaryTarget(
name: "BrainBitLib",
path: "BrainBitLib.xcframework"
),
.testTarget(
name: "BrainFlowTests",
dependencies: ["BrainFlow", .product(name: "Numerics", package: "swift-numerics")],
sources: ["BoardShimTests.swift",
"BrainFlowCItests.swift",
"BrainFlowTests.swift",
"DataFilterTests.swift"]
)
]
)
And here is a screenshot of Xcode showing the package contents and the error:
Thanks in advance,
Scott