【问题标题】:Unable to find a specification for `PrivatePodBB` depended upon by `PrivatePodAA`无法找到由“PrivatePodAA”依赖的“PrivatePodBB”规范
【发布时间】:2019-04-11 16:47:48
【问题描述】:

我创建了 2 个私有 pod,第一个是 PrivatePodAA,第二个是 PrivatePodBB,我可以在 PrivatePodAA podfile 中成功使用 PrivatePodBB,但是在尝试将其添加为 PrivatePodAA podspec 文件中的依赖项并尝试将 PrivatePodAA 作为新项目中的 pod 安装时它正在显示:

Unable to find a specification for `PrivatePodBB` depended upon by `PrivatePodAA`

我创建了自己的私有仓库并在其中添加了 PrivatePodBB podspec 文件。

在我的 PrivatePodAA 的 podfile 下方,它运行良好:

// my private repo url
source 'https://privateurl.prv/scm/ios/sdhub.git'
target 'PrivatePodAA' do
    pod 'PrivatePodBB', :git => 'https://privateurl.prv/scm/ios/PrivatePodBB.git'
    # pod 'PrivatePodBB' # this also working fine
end

下面是 PrivatePodAA 的 podspec 文件,这会导致问题:

Pod::Spec.new do |s|
  s.name             = 'PrivatePodAA'
  s.source           = {
     :git => 'https://privateurl.prv/scm/ios/PrivatePodAA.git', :tag => s.version.to_s
  }
  s.dependency 'PrivatePodBB'
end

同时在运行时:pod spec lint --sources=my-private-repo,master 完美运行

那么,请问上面的代码遗漏了什么?

【问题讨论】:

    标签: ios cocoapods podspec


    【解决方案1】:

    经过搜索,我终于将我的私人仓库的源代码添加到我的新项目中解决了我的问题。下面是我的新项目的示例 podfile:

    source 'https://privateurl.prv/scm/ios/sdhub.git'
    source 'https://github.com/CocoaPods/Specs.git'
    target 'testPrivatePod' do
      # Pods for testPrivatePod
      pod 'PrivatePodAA', :git => 'https://privateurl.prv/scm/ios/PrivatePodAA.git', :branch => 'privatePods'
    end
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-07-05
      • 2022-06-14
      • 2017-05-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多