funkybro
funkybro

Reputation: 8671

How to change the version of a Cocoapod's dependency

I am using a Cocoapod whose podspec specifies a dependency, and this dependency in turn specifies another.

The second-level dependency in question has a conflict with the latest beta version of Xcode 9. The issue has been fixed in the project's github but it has not appeared on Cocoapods yet.

But the dependency itself of course does not appear in my Podfile.

Is there an easy way to force the use of a specific version of the dependency in this case?

Upvotes: 4

Views: 9630

Answers (2)

funkybro
funkybro

Reputation: 8671

I solved this by simply adding the specific version of the dependency to my own Podfile.

This works because you cannot have multiple versions of a single Cocoapod in your project.

Example:

    pod 'MatrixKit', :git => 'https://github.com/My-Fork/matrix-ios-kit.git', :branch => 'master'
    pod 'MatrixSDK', :git => 'https://github.com/My-Fork/matrix-ios-sdk.git', :branch => 'master'
    pod 'MatrixSDK/Core', :git => 'https://github.com/My-Fork/matrix-ios-sdk.git', :branch => 'master'
    pod 'Realm', :git => 'https://github.com/My-Fork/realm-cocoa.git', :tag => 'v10.1.4', submodules: true

Upvotes: 6

Leon
Leon

Reputation: 410

On the bottom of the pod spec file do the following:

s.dependency "PromiseKit", "~> 4.0"
s.dependency "FMDB", "~> 2.6.2"

For more information look at the documentation: https://guides.cocoapods.org/making/specs-and-specs-repo.html

Upvotes: 1

Related Questions