I'm trying to separate the common codes into a standalone package, when i add it into the project either from local or from repo, i could just successfully build it.
But when i build the package alone, it just keep popping errors, , the compile error says "no such module 'SwiftProtobuf'", i try many ways to add it into the target's dependencies, but it just don't work.
The content of Package.swift is written below, anyone knows how to solve this
// swift-tools-version: 5.8
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "IosCommon",
platforms: [.iOS(.v15)],
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(
name: "IosCommon",
targets: ["IosCommon"]),
],
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
.package(url: "https://github.com/evgenyneu/keychain-swift", from: "20.0.0"),
.package(url: "https://github.com/Alamofire/Alamofire", from: "5.0.0"),
.package(url: "https://github.com/Jake-Short/swiftui-image-viewer.git", from: "2.0.0"),
.package(url: "https://github.com/apple/swift-protobuf.git", .upToNextMajor(from: "1.0.0")),
.package(url: "https://github.com/apple/swift-ui.git", from: "0.0.0"),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages this package depends on.
.target(
name: "IosCommon",
dependencies: [
"Alamofire",
.product(name: "KeychainSwift", package: "keychain-swift"),
.product(name: "SwiftProtobuf", package: "swift-protobuf"),
.product(name: "ImageViewer", package: "swiftui-image-viewer"),
.product(name: "ImageViewerRemote", package: "swiftui-image-viewer"),
.product(name: "UIKit", package: "swift-ui"),
],
path: "Sources"
),
]
)