问题
How do I remove dependency from a pod?
I have a podfile with
pod 'GData'
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
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'
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.
回答1:
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": [
]
}
to
"dependencies": {
"gtm-oauth2": [
]
}
And now pod will be installed without "GTMHTTPFetcher".
来源:https://stackoverflow.com/questions/29595295/remove-dependency-from-pod