Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Podspec Link Binary Library

Tags:

ios

cocoapods

I'm attempting to create a Podspec for: https://github.com/sincerely/shiplib-ios-framework

Pod Lint passes & the files are being added to the project but it does not link the binary "Sincerely" file. The sample project build fails due to missing files when importing via: <Sincerely/filename.h>

 Pod::Spec.new do |s|
  s.name  = 'ShipLib'
  s.version = '1.4'
  ...
  s.source = {
    :git => 'https://github.com/sincerely/shiplib-ios-framework.git',
    :tag => 's.version.to_s'
  } 
  s.library = 'Sincerely'
  s.source_files = 'Sincerely.framework','Sincerely.framework/Headers/*.h'
  s.resources = 'Sincerely.framework/Resources/*.{png,nib}'
  s.frameworks = 'AddressBook', 'AddressBookUI', 'SystemConfiguration', 'CoreTelephony'
  s.xcconfig  =   { 'LIBRARY_SEARCH_PATHS' =>  '$(PODS_ROOT)/ShipLib/' }
end

Edit:

Pod::Spec.new do |s|
  s.name  = 'ShipLib'
  s.version = '1.4'
  s.platform = :ios
  s.summary = 'Allow users to send printed photos from your app.'
  s.author = { 'Sincerely' => '[email protected]' }
  s.homepage = 'https://github.com/sincerely/shiplib-ios-framework'
  s.license = { :file => 'LICENSE', :type => 'Commercial' }
  s.source = {
    :git => 'https://github.com/sincerely/shiplib-ios-framework.git',
    :tag => 's.version.to_s'
  }
  s.frameworks = 'AddressBook', 'AddressBookUI', 'SystemConfiguration', 'CoreTelephony'
  s.ios.vendored_frameworks = 'Sincerely.framework'
end
like image 555
pws5068 Avatar asked Aug 13 '13 21:08

pws5068


People also ask

What is a Podspec file?

A Podspec, or Spec, describes a version of a Pod library. One Pod, over the course of time, will have many Specs. It includes details about where the source should be fetched from, what files to use, the build settings to apply, and other general metadata such as its name, version, and description.

Is a Cocoapod a framework?

A shared framework in Cocoapods is refered to as a pod . Once we have captured our project targets and its requirements we have to tell Cocoapods to set up our project based on our project specification.


1 Answers

Headers will not be copied for frameworks, and should not be specified as source files. If all you are looking to do is add the framework as a vendored_framework. This is new in CP 0.23.0.

From the Documentation

  spec.ios.vendored_frameworks = 'Frameworks/MyFramework.framework'

Edit:
Remove all the stuff about the .framework from s.source_files. Source files are just that, files, not frameworks.

like image 194
MishieMoo Avatar answered Sep 19 '22 22:09

MishieMoo