在CocoaPods中找不到规格 [英] Unable to find a specification in CocoaPods

查看:90
本文介绍了在CocoaPods中找不到规格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不明白为什么在运行pod install时Cocoapod无法找到我创建的Pod规范.有人可以帮我解决这个问题吗?

I cannot understand why the Cocoapod is unable to find the pod specification I created when I run pod install. Could someone help me solve this trouble?

我正在像这样在我的库podspec文件中定义一个子规范:

I'm defining a subspec in my library podspec file like this:

s.subspec 'mysubspec' do |c|
  c.dependency 'ABC','1.0.0'
end 

此依赖项ABC在Podfile库中列出:

This dependency ABC is listed in the library Podfile:

pod 'ABC', :git => 'git@github.com:myrepo/Podspecs.git', :branch => 'xyz'

myrepo/Podspecs分支xyz中的Podspec文件ABC.podspec看起来像这样:

The Podspec file ABC.podspec in the branch xyz of myrepo/Podspecs seems like this:

Pod::Spec.new do |s|
  s.name         = "ABC"
  s.version      = "1.0.0"
  s.source       = { :git => "git@github.com:myrepo/Podspecs.git", :branch => "xyz" }
end

错误是[!] Unable to find a specification for ABC (= 1.0.0)

解决方案::在导入子规格之前,先导入Pod ABC,然后将标签添加到podspec.

Solution: import the pod ABC before importing the subspec and add the tag to the podspec.

推荐答案

而不是:

s.source       = { :git => "git@github.com:myrepo/Podspecs.git", :branch => "xyz" }

写下: 不要忘记标签...

Write this: Don't forget the tag...

s.source       = { :git => "https://github.com/myrepo/Podspecs.git", :branch => "xyz",
                   :tag => s.version.to_s }

这篇关于在CocoaPods中找不到规格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆