Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add Pod dependency with source to .podspec

I am trying to add the following dependency to my Podspec

s.dependency 'Apollo/WebSocket', :git => 'https://github.com/apollographql/apollo-ios'

Here's what I get in my Terminal whenever I try to run pod lib lint MyPodName.podspec:

- ERROR | spec: The specification defined in `MyPodName.podspec` could not be loaded.


[!] Invalid `MyPodName.podspec` file: [!] Unsupported version requirements.

 #  from <PathToMyPodspec>/MyPodName.podspec:36
 #  -------------------------------------------
 #    
 >    s.dependency 'Apollo/WebSocket', :git => 'https://github.com/apollographql/apollo-ios'
 #    
 #  -------------------------------------------

I have successfully used it as a Pod in one of my iOS projects. But now that I am creating a pod myself, I am struggling to understand what I should do to make it work.

Thank you in advance!

like image 980
EBDOKUM Avatar asked Apr 18 '19 12:04

EBDOKUM


People also ask

What is POD repo add?

cocoapods-repo-update is a CocoaPods plugin that checks your dependencies when you run pod install and updates the local specs repositories if needed.

How do I add pods dependencies?

You can add dependencies on subspecs. Specify the minimum deployment target version for the Pod library. Re-import the project.

How do I add a dependency pod in Xcode?

You can manually create a Podfile with a text editor or execute the pod init command at the root of your Xcode project. This command creates a Podfile at the root of your Xcode project. Open the file in your favorite text editor.


1 Answers

It looks like it is not allowed to define dependency in PodSpec like this. Please refer CocoaPod guideline document on Dependency

It seems it should contain only version information like mentioned below. Other formats are not allowed.

enter image description here

like image 71
Anand Avatar answered Oct 18 '22 22:10

Anand