Xcode can't find the other framework in swift package

Hi all,

I have a xcworkspace where contains 2 projects

  1. MyLib is a xcframework project
  • In [Package Dependencies], it depends on Kingfisher
  1. MyApp is an app project
  • In [Package Dependencies], it depends on Firebase
  • In [Frameworks, Libraries, and Embedded Content], it has MyLib.framework with Embed & Sign.

If I build MyLib, the build is successful.

If I build MyApp, xcode first builds MyLib, and fails on "module Kingfisher is not found". How can I fix this problem???

In fact, I manage my projects with cocoapod. Now, I want to migrate them to SPM. This is the way I figure out to manage my projects with Xcode. If there is a better way to do, please tell me.

Thank you in advanced.

1 Like

If you can share a small sample, that may be helpful. We've had challenges around xcframeworks that import swift packages but were able to work around them. It's hard to say what the issue is as there are several things that can go wrong.

@gestrich Thank you for your replying.

Finally, I converted all my xcframework projects to Swift packages except the iOS App project. This solves all dependency issues, but it creates another issue that I can not build a Swift package to a binary xcframework. Eventually, I fixed this too. Now, it works perfectly.

1 Like

@xhhuango how did you manage to create an xcframework of a swift packge?

I followed the instructions described in How to build Swift Package as XCFramework

I also wrote an article about it:

1 Like