Cocoapods没有正确链接私有框架Pod

时间:2023-01-17 23:58:16

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

我试图将一系列Pod链接在一起以封装项目功能并且已经遇到了问题。

I have 3 Pods:

我有3个豆荚:

  • IOS-Intrasonics -> contains Intrasonics.framework
  • IOS-Intrasonics - >包含Intrasonics.framework

  • IOS-Core -> contains core API and Intrasonics functionality
  • IOS-Core - >包含核心API和Intrasonics功能

  • IOS-Consumer -> contains the consumer app that makes use of the core
  • IOS-Consumer - >包含使用核心的消费者应用程序

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都位于私有存储库中。现在,当我在IOS-Core上运行pod spec lint时,它会返回:

$ 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!

即使Podspec将IOS-Intrasonics列为依赖项,它也不会将其链接起来。 IOS-Intrasonics包含在Podfile中并且在项目中工作得很好但它不能作为依赖项工作。请帮忙!

2 个解决方案

#1


0  

This looks like it's caused by you not including any public header files in the spec where you're vendoring your framework. You'd want to do that with something like:

这看起来像是由于您未在规范中包含任何公共头文件而导致您正在销售框架。你想用以下的东西做到这一点:

s.public_header_files = 'path/to/headers/*.h'

#2


0  

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.

我最后捆绑了我想用框架pod添加的类,而不是包含pod和框架的pod。

#1


0  

This looks like it's caused by you not including any public header files in the spec where you're vendoring your framework. You'd want to do that with something like:

这看起来像是由于您未在规范中包含任何公共头文件而导致您正在销售框架。你想用以下的东西做到这一点:

s.public_header_files = 'path/to/headers/*.h'

#2


0  

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.

我最后捆绑了我想用框架pod添加的类,而不是包含pod和框架的pod。