Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the version of a Cocoapod's dependency

Tags:

ios

cocoapods

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?

like image 887
funkybro Avatar asked Oct 27 '25 10:10

funkybro


1 Answers

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
like image 111
funkybro Avatar answered Oct 30 '25 01:10

funkybro



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!