Xcode Creating a framework that has cocoapods dependencies
Asked Answered
N

3

11

I'm currently developing a framework for internal usage, but I'm having trouble getting it to play nicely. The issue i seem to be having is that the framework uses cocoapods for some of its dependencies, and then when I tried to test is in a blank project by adding it as subproject it and then import it, it won't build and complains saying "No such module 'x'".

Ideally instead of a subproject id like it to work purely as a framework but I'm just taking baby steps for now.

Nita answered 17/6, 2017 at 7:27 Comment(1)
Did you ever figure this out? I'm also trying to include my framework (with Cocoapod dependencies) in a subproject, but can't get past "framework not found" errors when it tries to find the pods.Cobwebby
P
0

If you developing a framework with some dependencies you will have next diagram

application -> Framework -> dependencies

You have next variants:

  • If you try to create Umbrella framework[About] it is not a good practice
  • Use Cocoapods[About] as a dependency manager. If your framework is private you can use closed source[About] distribution
  • Try to add (and manage) all framework's dependencies to application target
Peshawar answered 26/9, 2022 at 17:32 Comment(0)
T
-1

The CocoaPods "pod lib create" tutorial is a good way to learn the CocoaPods framework creation steps incrementally.

Thunderbolt answered 17/6, 2017 at 14:18 Comment(2)
I have used that guide, but it does not say anything pertaining to my particular situation that is vexing me. Right now Im working on a framework that wont be available publicly and when trying to use the framework which has pods it depends on, the compiler says it cant locate the pods in the internal framework i have created.Nita
Your question may be clearer if you add the relevant Podfile and podspecThunderbolt
B
-1

Just a quick note - I got this "No such module MODULE" error when I created my local pod by creating an Xcode project for a new framework and then running pod spec create MODULE.

I tried again by just running

pod lib create MODULE

(without creating any Xcode projects beforehand), and the error isn't bothering me any more. (I'm accessing this pod privately adding pod 'MODULE', :path => '../ModulePath' in my Podfile from another project)

Ballonet answered 12/6, 2019 at 9:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.