Using Xcode 12 beta and swift-tools-version 5.3, you can link to a framework, like this:
.binaryTarget(
name: "Stripe",
url: "https://github.com/stripe/stripe-ios/releases/download/v19.3.0/Stripe.xcframework.zip",
checksum: "fe459dd443beee5140018388fd6933e09b8787d5b473ec9c2234d75ff0d968bd"
)
But when I needed to update the checksum (I had it wrong) I get
: artifact of binary target 'Stripe' has changed checksum; this is a potential security risk so the new artifact won't be downloaded
How can I reset this, or override it when I need to change the checksum?
To distribute code in binary form as a Swift package, create an XCFramework bundle, or artifact, that contains the binaries. Then, make the bundle available locally or on a server: When you host the binaries on a server, create a ZIP archive with the XCFramework in its root directory and make it available publicly.
Swift package source archives are Zip files. You can generate a source archive by running swift package archive in the root directory of a package. SYNOPSIS swift package archive [--output=<file>] OPTIONS -o <file>, --output=<file> Write the archive to <file>. If unspecified, the package is written to `\(PackageName).
To resolve, Open the project from the project panel, select the project (not the targets), then select the "Swift Packages" tab. Double click on the package you want to update and change the minimum version to the next major version.
In order to cache the dependencies, they should be located in the project directory, but by default, SPM downloads the dependencies into the system folder: ~/Library/Developer/Xcode/DerivedData.
In order to get rid of the error, you need to purge Xcode's local package caches.
In Xcode's File menu, select 'Swift Packages' and then 'Reset Package Caches'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With