4

This question is in regards to podspec with vendor framework and use_frameworks! in the pod file

I've created a Podspec for my framework (which contains swift and obj-c code). The aforementioned pod spec is for a vendor framework (i.e closed-source) which is already compiled as an an iOS embedded framework, which itself contains swift and objective-c code ("mixed project").

The framework has an umbrella header and defines a module and works as expected when embedded directly to a project (manually without pods ,Drag-and-drop into a project) and using the syntax in the hosting app:

#import <MyFramework/Myframework.h>

The framework header has the standard lines:

//! Project version number for MyFramework.
FOUNDATION_EXPORT double MyFrameworkVersionNumber;

//! Project version string for MyFramework.
FOUNDATION_EXPORT const unsigned char MyFrameworkVersionString[];

// In this header, you should import all the public headers of your framework using statements like #import <MyFramework/PublicHeader.h>
#import <MyFramework/Header_one.h>
#import <MyFramework/Header_two.h>
... etc.

The corresponding pod-spec that I am trying (and many combinations there of...)

Pod::Spec.new do |s|
  s.name         = "MyFramework"
  s.version      = "1.0.0"
  s.summary      = "MyFramework SDK."
  s.description  = "Some sort of long description of the pod"
  s.homepage     = "http://MyFramework.com/"
  s.license      = { :type => "Commercial", :text => "MyFramework Copyright 2015 ...." }
  s.author       = { "Avner Barr" => "avner@abc.com" }
  s.platform     = :ios, "8.0"
  s.source       = { :http => "http://somewhere_over_the_rainbow/MyFramework.zip" }
  s.public_header_files = "MyFramework.framework/Headers/*.h"
  s.module_map = "MyFramework.framework/Modules/module.modulemap"
  s.preserve_paths = "InsertFramework.framework/*"
  s.vendored_frameworks = "MyFramework.framework"
  s.requires_arc = true
end

In the pod file of the host app:

source '.../.../MyPrivateTestingPodSpecRepo.git'
use_frameworks!
target 'TestPSpec1' do
pod 'MyFramework'
end

The pod downloads and creates the workspace as expected but in swift code when trying to do:

import MyFramework

I get the error:

Include of non-modular header inside framework module 'MyFramework'

With a "red" error in the objective-c header (the <> syntax).

i.e.

MyFramework.h
#import <MyFramework/Header_one.h> Include of non-modular header inside framework module 'MyFramework'
Avba
  • 14,822
  • 20
  • 92
  • 192

1 Answers1

-1

Try going to the root of your project directory where the podfile is located in terminal, then type in 'pod install' and hit enter. If it still doesn't work try typing in 'pod uodate'

Kevin Rajan
  • 827
  • 8
  • 28