Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is podfile.lock in our Xcode projects and why is it used?

I am a beginner in using pods in Xcodeprojects. I have been confused by pod file.lock. I want to update a framework "OBJECTMAPPER" to 2.0 to make it compatible with swift 3. however it does't.

why doesn't it update to the latest version (2.0). Does it have anything to do with pod file.lock. which is as follows->

enter image description here

and why is it used?

Update: The podfile enter image description here

like image 316
Jeesson_7 Avatar asked Mar 08 '17 12:03

Jeesson_7


2 Answers

Just In case any one is wondering the same i did 2 years ago. I will tell a small description. When u install a library with cocoapods you will be generated a podlock against it with the version which it(The library) is installed. For example suppose you have library named "XX" and you install it with pods. if the latest version of "XX" is 2.0.0, then u will be installed the latest version and podfile.lock is locked with -(XX - (2.0.0))

Suppose if a new version is released of that library and u dont want it's updates to be installed in our project then use pod install.. This will only install any new library in podfile and will not affect your existing library by updating them to latest code.("This prevents some functions of that library which you have used to not disappear if they have depricated it").This is monitored by podfile.lock

If you want to update "XX" to a newer version in future use pod update for that library

like image 169
Jeesson_7 Avatar answered Sep 23 '22 20:09

Jeesson_7


pod install will not update ObjectMapper to the latest version because there is no reason for it to do so. ObjectMapper is included as a dependency to UberRides and version 1.5.0 satisfies the requirement which is 1 or above.

In order to force an update you can add ObjectMapper to the podfile with the required version, e.g.

pod 'ObjectMapper', '2.0'
like image 20
mlidal Avatar answered Sep 23 '22 20:09

mlidal