You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Can Xcode/SPM support retrieving a binary target hosted remotely which requires additional authentication?

We have a signed xcframework which doesn't survive inclusion in our repo. I can add the framework locally where everything builds and runs but pulling from our remote repo (GitHub Enterprise) after push (using git lfs) breaks the signature and we can no longer compile.


I have wrapped the framework in a Swift Package with a BinaryTarget and hosted the zipped framework using Artifactory but Xcode is unable to resolve the dependency, returning a "failed downloading ' which is required by binary target 'myTarget': badResponseStatusCode (401)" error.


Is it possible to resolve a Swift Package dependency in Xcode which requires additional authentication to download the payload? Without such a solution, I'm not sure how our CI/CD pipeline will continue to work.


Thanks!


[Edited by Moderator]

MacBook Pro 16″, macOS 15.0

Posted on Oct 18, 2024 3:19 PM

Reply
Question marked as Top-ranking reply

Posted on Oct 23, 2024 2:19 AM

I am having the same issue and I'm getting desperate. This is something that was working until recently. Not sure if its due to Sequoia, Xcode16 or something else. It went unnoticed for some time since Xcode was using cached versions of the spms, but after removing those, 401 it is.



I have checked my ssh keys, my PAT tokens, my .netrc file... everything seems alright.

But when it comes to adding the Swift package dependency with a BinaryTarget to Xcode, I get a 401.


My Package.swift for reference, is:


// swift-tools-version:5.3
import PackageDescription


let package = Package(
    name: "framework_name",
    platforms: [
        .iOS(.v14)
    ],
    products: [
        .library( 
            name: "framework_name",
            targets: ["framework_name"])
    ],
    dependencies: [
    ],
    targets: [
        .binaryTarget(
            name: "framework_name",
            url: "https://api.github.com/repos/team_name/repo_name/releases/assets/id_number.zip",
            checksum: "fdea5_the zips_checksum_24854e"
        )
    ]
)


MacBook Pro 14", 2021, Apple M1 Pro

Sequoia 15.0.1

Xcode 16.0


Please help.

2 replies
Question marked as Top-ranking reply

Oct 23, 2024 2:19 AM in response to soob

I am having the same issue and I'm getting desperate. This is something that was working until recently. Not sure if its due to Sequoia, Xcode16 or something else. It went unnoticed for some time since Xcode was using cached versions of the spms, but after removing those, 401 it is.



I have checked my ssh keys, my PAT tokens, my .netrc file... everything seems alright.

But when it comes to adding the Swift package dependency with a BinaryTarget to Xcode, I get a 401.


My Package.swift for reference, is:


// swift-tools-version:5.3
import PackageDescription


let package = Package(
    name: "framework_name",
    platforms: [
        .iOS(.v14)
    ],
    products: [
        .library( 
            name: "framework_name",
            targets: ["framework_name"])
    ],
    dependencies: [
    ],
    targets: [
        .binaryTarget(
            name: "framework_name",
            url: "https://api.github.com/repos/team_name/repo_name/releases/assets/id_number.zip",
            checksum: "fdea5_the zips_checksum_24854e"
        )
    ]
)


MacBook Pro 14", 2021, Apple M1 Pro

Sequoia 15.0.1

Xcode 16.0


Please help.

Can Xcode/SPM support retrieving a binary target hosted remotely which requires additional authentication?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.