6

I am creating an SPM using the binary framework. I upload a zip file on the server and that link is used in SPM.

let package = Package(
name: "MyDemoPackage",
platforms: [
    .iOS(.v13)
],
products: [
    
    .library(
        name: "MyDemoPackage",
        targets: ["MyDemoPackage"]),
],
dependencies: [
    
],
targets: [
    
    .binaryTarget(
        name: "MyDemoPackage",
        url:"https:domain.com/frameork.zip",
        checksum: "29725502a0b4e61c375f71eec3d5432ac84c")           
]
)

After compilation shows an error

Showing Recent Messages downloaded archive of binary target 'MyDemoPackage' does not contain expected binary artifact 'MyDemoPackage'.

I am unable to figure out how to resolve this error. Can anyone help me out?

3
  • Is there a missing w in the url spelling? Commented Mar 1, 2022 at 14:25
  • @PaulBeusterien I know w is missing, it's just the framework name. Commented Mar 1, 2022 at 17:59
  • Did you find any solutions. I'm facing same issue. If I use framework locally or package it with Swift Package it works fine. But when I use url it displays same error. Commented Aug 17, 2023 at 12:48

3 Answers 3

4

Binary Target name should match the name of the module defined by xcframework.

Sign up to request clarification or add additional context in comments.

2 Comments

To clarify "module" here, I build PopH264.xcframework which contains PopH264_Osx.framework and PopH264_ios.framework. My binarytarget() .name had to be PopH264
The module name is encoded into machO binary. The good way to check the right module name is to link the sample project against the framework and import its module (aka import SomeModule). Then name the target name accordingly.
2

I had a similar issue, probably because of the version differences in Xcode. What worked for me was deleting Package.resolved file, clean and build again.

Comments

1

This may also happen if you have used ditto without --keepParent argument to compress the framework. source

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.