YourAdHere YourAdHere - 1 year ago 187
iOS Question

Unable to import third party framework into a cocoapod

I have looked at the documentation on the Cocoapods site, several questions here and articles on various sites, but nothing thus far has resolved this for me.

The issue is that I had to create an iOS framework that needs to be placed into a private Cocoapod for use within my organization. I have focused on several variations of the vendored_frameworks option, but nothing has succeeded in importing the framework into my target project.

Below is a subset of my Podspec file: = "MyCocoaPod"
s.source_files = 'MyCocoaPod/Classes/**/*'
s.vendored_frameworks = 'Framework/MyFramework.framework'

This project was created via the
pod lib create
command. The framework in question is located in the Frameworks\iOS folder under Pods project in Xcode.

On the file system, the framework is located at

The framework is written in C++ and works properly when placed in a regular project.

The installed version of Cocoapods is 0.39.0.

Some things that I have tried:

  • Using s.ios.vendored_frameworks

  • Using preserve_paths

  • Changed the path for vendored_frameworks to use the file system path

  • Move the framework in to the MyCocoaPod/Classes folder

  • Add the framework to s.source_files

  • Using 'Framework/iOS/MyFramework.framework' for vendored_framework path

Answer Source

I finally solved this odd case.

First, I deleted the project and had cocoapods generate a new one with the pod lib create command.

Next, I deleted the default folder under development pods and then copied the framework file into the project under the Development/PodName folder.

I then added s.vendored_frameworks = 'MyFramework' to the podspec file. Previously, I tested not including the Framework/ path under vendored_frameworks without success.

Upon importing to the target, it successfully appeared.

The only new thing I did was to use a new project, so I assume some setting in th previous one was incorrect.