运行podinstall时“您的项目未明确指定CocoaPods主规范存储库”警告

跑完后pod install,我收到一条警告:

[!] 您的项目没有明确指定 CocoaPods 主规范存储库。由于 CDN 现在被用作默认设置,您可以通过pod repo remove master.

要取消此警告,请添加warn_for_unused_master_specs_repo => false到您的 Podfile。

为什么我收到这个警告?以前,我可以在pod install没有任何警告的情况下运行。

如果有帮助,这是另一个细节:我无法sudo gem install用于安装/升级 CocoaPods,所以我改用了以下命令:

sudo gem install -n /usr/local/bin cocoapods

回答

运行“pod repo remove master”时,我收到了以下信息:

[!] repo master does not exist

我做了一个......

pod repo list

cocoapods
- Type: git (master)
- URL:  https://github.com/CocoaPods/Specs.git
- Path: /Users/plasma/.cocoapods/repos/cocoapods

trunk
- Type: CDN
- URL:  https://cdn.cocoapods.org/
- Path: /Users/plasma/.cocoapods/repos/trunk

注意到“主人”实际上被称为“cocoapods”,所以我做了一个..

pod repo remove cocoapods

已经完成的一个我能够进行更新和安装而没有任何错误。


回答

运行命令 pod repo remove master

  • This results in the following output: ` [!] repo master does not exist`
  • It has relation to this change which removes git repo and makes trunk default repository https://github.com/CocoaPods/CocoaPods/pull/8923 I have solved the problem by listing repos 'pod repo list' and then removing master 'pod repo remove' leaving only trunk
  • For me `pod repo remove cocoapods`

回答

我通过source在 Podfile 的顶部添加一个来解决这个警告:

source 'https://github.com/CocoaPods/Specs.git'


回答

我建议遵循 Plasma 的回答。但是,如果您不想删除主存储库,只需warn_for_unused_master_specs_repo通过更改此设置将设置添加到 Podfile 来静音警告:

install! 'cocoapods'

对此:

install! 'cocoapods', :warn_for_unused_master_specs_repo => false

如果在 之后已有选项install! 'cocoapods',请在新设置后添加逗号:

install! 'cocoapods', :deterministic_uuids => false, :warn_for_unused_master_specs_repo => false


以上是运行podinstall时“您的项目未明确指定CocoaPods主规范存储库”警告的全部内容。
THE END
分享
二维码
< <上一篇
下一篇>>