0

I tried different ways with different configurations and cannot make it run. Here is what I tried while creating the xcframework:

  • Add 1 framework dependency as pod

  • Add 1 framework dependency as Swift package (MKRingProgressView) and created also a swift package marking the dependency in the package dependency as follows:

      name: "FirstFramework",
      platforms: [
       .iOS(.v15)
      ],
      products: [
      // Products define the executables and libraries a package produces, and make them visible to other packages.
      .library(
          name: "FirstFramework",
          targets: ["FirstFramework"]),
      ],
      dependencies: [
        .package(url: 
          "https://github.com/maxkonovalov/MKRingProgressView.git", 
           from: "2.3.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.
      .binaryTarget(
          name: "FirstFramework",
          path: "./Sources/FirstFramework.xcframework")
       ]
    
  • Set build libraries for distribution to YES

I am always getting the error "No such module MKRingProgressView" when adding my framework to a Test project, so its not recognising the dependency of my framework.

Any ideas?

7
  • Did you add the MKRingProgressView as a dependency for your framework in the Package.swift? Could you share it? See stackoverflow.com/questions/69562987/… Commented Aug 25, 2022 at 9:39
  • Hi Larme, Yes you can see in the question the code, I added it as a dependency of the Swift package as well as the binary as target of the package Commented Aug 25, 2022 at 9:42
  • But currently, I don't see why FirsrtFramework should use the dependency. You could have multiple binary, and each one using a different dependency, no need to use all dependency in each binary. Could you share the whole swift package (and hide some infos if needed)? Commented Aug 25, 2022 at 10:20
  • This is my whole package file, the main issue is that I cant find the way to link dependencies to my binaryTarget, will edit in the question because cannot paste it here Commented Aug 25, 2022 at 10:47
  • 1
    I'm wondering if you don't need to add a .target(name: "FirstFrameworkWithDependency", dependencies: ["MKRingProgressView"]),, to let the dependency be done, and then refer to it later. See stackoverflow.com/questions/65220359/… Commented Aug 25, 2022 at 10:54

0

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.