从pod移除依赖 [英] Remove dependency from pod

查看:243
本文介绍了从pod移除依赖的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从pod中删除依赖项?

How do I remove dependency from a pod?

我有一个podfile,

I have a podfile with

pod 'GData'

这似乎已损坏,因为它会生成163个重复项符号错误。我想我知道那是什么。在安装时,可以观察到以下情况:

which seems to be broken, because it generates 163 duplicate symbols errors. I think I know what it is. While installing this can be observed:

Installing GTMHTTPFetcher (1.141)
Installing gtm-http-fetcher (1.0.141)

[!] GTMHTTPFetcher has been deprecated in favor of gtm-http-fetcher

不需要其中之一。因此,要删除它,我尝试修改podfile以使用自定义的本地podspec文件:

One of these is not needed. So to remove it I try to modify podfile to use custom, local podspec file:

podspec :path => '~/GData.podspec.json'

我在哪个podspec文件中复制了所有原始JSON podspec内容如果没有GTMHTTPFetcher,则不会安装GData。如果我只是复制原始内容并且根本不做任何更改,甚至会发生这种情况。所有依赖项均已安装,但GData本身未安装。我认为我在这里缺少什么。

In which podspec file I copy all of original JSON podspec contents without GTMHTTPFetcher, GData DOES not install. It even happens if I just copy original contentes and don't change anything at all. All dependencies are installed, but GData itself is not. I think that I'm missing something here.

推荐答案

以下是使用自定义podspec(JSON格式)的正确podfile语法:

Here is proper podfile syntax for using custom podspec (in a JSON format):

pod 'pod_name_goes_here', :podspec => 'path/to/your/file.podspec.json'

要删除依赖项,只需删除一个来自依赖项的条目,例如更改

And to delete dependency, simply remove an entry from 'dependencies', for example change

"dependencies": {
  "GTMHTTPFetcher": [
  ],
  "gtm-oauth2": [
  ]        
}

"dependencies": {
  "gtm-oauth2": [
  ]        
}

现在将安装没有 GTMHTTPFetcher的pod。

And now pod will be installed without "GTMHTTPFetcher".

这篇关于从pod移除依赖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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