Hi, I was using Cocoapods till now and decided to go with SPM. I only to distribute binary of Framework but it depends on different SPM Libraries. Now the problem is to ship this package.
I created Package.swift
file in the different repo as I don't want to share the source of project. I also get help from one of the questions asked here (Binary target with sub-dependency).
Every time I add to a different project to see if it is working or not, it gives me an error.
The transcript is given below.
Showing All Messages
**artifact of binary target 'OneLoadNetwork' failed extraction: The operation couldn’t be completed. (TSCBasic.StringError error 1.)**
Adding Package Failed 23/06/2021, 11:09 PM 12.2 seconds
This is my Package.swift
looks like. I tried everything I know, but unable to resolve this issue.
// swift-tools-version:5.3
import PackageDescription
let package = Package(
name: "OneLoadNetwork",
platforms: [.iOS(.v11)],
products: [.library(name: "OneLoadNetwork", targets: ["OneLoadNetwork"])],
dependencies: [
.package(url: "https://github.com/Alamofire/Alamofire.git", .upToNextMajor(from: "5.4.3")),
.package(url: "https://github.com/CocoaLumberjack/CocoaLumberjack.git", .upToNextMajor(from: "3.7.0")),
.package(url: "https://github.com/jdg/MBProgressHUD.git", .upToNextMajor(from: "1.2.0")),
.package(url: "https://github.com/kishikawakatsumi/KeychainAccess.git", .upToNextMajor(from: "3.0.0"))
],
targets: [
.binaryTarget(name: "OneLoadNetwork", url: "https://some/public/url/OneLoadNetwork-20210623222833.xcframework.zip", checksum: "ce3f19974df628a7fd896ea455897384030cc433d0620de47b98fd20027b9fcc"),
.target(
name: "OneloadNetwork",
dependencies: [
.target(name: "OneLoadNetwork", condition: .when(platforms: .some([.iOS]))),
.product(name: "CocoaLumberjackSwift", package: "CocoaLumberjack"),
.product(name: "Alamofire", package: "Alamofire"),
.product(name: "MBProgressHUD", package: "MBProgressHUD"),
.product(name: "KeychainAccess", package: "KeychainAccess"),
]
)
],
swiftLanguageVersions: [.v5]
)
I'm unable to exact contents of framework but Xcode gives me error everytime about extraction.