0

I'm having the framework which has the external dependency with Alamofire. If I try to use the framework in my project, it showing ld: framework not found Alamofire in framework

I had setup all things to consume the framework in project.

  • Added framework in Embedded binaries and Build copy phase file

Things which I have tried: Check here

I need to use my framework with external pod dependencies.

Note: I have searched a lot and tried many solutions but know work in my case.

sathish
  • 571
  • 1
  • 5
  • 16

1 Answers1

0

You may use a dependency manager like Carthage or CocoaPods in order to manage external dependencies in your framework. Follow their instructions how to use a framework from within a framework. This is the easy part.

Enable CocoaPods respectively Carthage in your framework so that it can be imported as external dependency by other projects. For CocoaPods this is more elaborated and requires you to create and publish a Podspec. Note, that you can create a private Pod if you don't want to share your framework. You will find more resources in the web (CocoaPods) how to accomplish all this. For Carthage usually there's little to no extra effort. Host your framework in some repository (private or public).

In your application, follow the instructions from the dependency manager how to import dependencies for an app. You possibly need to explicitly add secondary dependencies for Carthage (i.e. Alamofire) much like you add other depenendcies. CocoaPods would do this for your app project automatically when you install the Pods.

Import your framework in your sources. Before you build, ensure your dependencies will be build. Again, look for the documentation of the dependency manager how you accomplish this.

CouchDeveloper
  • 18,174
  • 3
  • 45
  • 67