Search code examples
iosobjective-ccocoapodspodspec

Cocoapods Not Linking Private Framework Pod Correctly


I am trying to link a series of Pods together to encapsulate project functionality and have arrived at an issue.

I have 3 Pods:

  • IOS-Intrasonics -> contains Intrasonics.framework
  • IOS-Core -> contains core API and Intrasonics functionality
  • IOS-Consumer -> contains the consumer app that makes use of the core

Intrasonics Podspec:

Pod::Spec.new do |spec|
  spec.name                    = 'IOS-Intrasonics'
  spec.version                 = '1.0.7'
  spec.license = {
    :type => 'Copyright',
    :text => <<-LICENSE
        Copyright 2014 Intrasonics Limited. All rights reserved.
        LICENSE
  }
  spec.homepage                = 'http://www.intrasonics.com'
  spec.authors                 = { 'xxxx' => 'xxxxx' }
  spec.summary                 = 'Intrasonics SDK'
  spec.source                  = { :git => 'git@github.com:xxxxx/IOS-Intrasonics.git', :tag => '1.0.7'}

  spec.ios.deployment_target   = '7.0'
  spec.ios.vendored_frameworks = 'src/IntrasonicsDecoder.framework'
  spec.ios.frameworks          = 'AVFoundation', 'AudioToolbox'

  spec.requires_arc            = true
end

IOS-Core Podspec:

Pod::Spec.new do |spec|
  spec.name                    = 'IOS-Core'
  spec.version                 = '1.0.0'
  spec.license = {
    :type => 'Copyright',
    :text => <<-LICENSE
        Copyright 2014 xxxxxxx. All rights reserved.
        LICENSE
  }
  spec.authors                 = { 'xxxx' => 'xxxx' }
  spec.homepage                = 'xxxx'
  spec.summary                 = 'Core'
  spec.source                  = { :git => 'git@github.com:xxxx/IOS-Core.git', :tag => '1.0.0'}

  spec.ios.deployment_target   = '7.0'

  spec.ios.public_header_files = 'Core/Core/**/*.h'
  spec.ios.source_files        = 'Core/Core/**/*.{h,m}'

  spec.ios.dependency          'AFNetworking'
  spec.ios.dependency          'IOS-Intrasonics'

  spec.requires_arc            = true
end

Both of these Pods are located in a private repository. Now, when I run, pod spec lint on IOS-Core, it returns this:

$ pod spec lint

 -> IOS-Core (1.0.0)
    - ERROR | [xcodebuild]  IOS-Core/Core/Core/Models/Events/FNXCIntrasonicsEvent.m:11:9: fatal error: 'IntrasonicsDecoder/IntrasonicsDecoder.h' file not found
    - ERROR | [xcodebuild]  IOS-Core/Core/Core/Helpers/Core/FNXCIntrasonicsManager.m:13:9: fatal error: 'IntrasonicsDecoder/IntrasonicsDecoder.h' file not found

Analyzed 1 podspec.

[!] The spec did not pass validation.

Even though the Podspec lists IOS-Intrasonics as a dependency, it isn't linking it. IOS-Intrasonics is included in the Podfile and works in the project just fine but it doesn't work as a dependency. Please help!


Solution

  • I ended up bundling in the classes I wanted to add with the framework pod instead of the pod that included the pod with the framework.