After upgrading from 0.33.1 to 0.34.1 today, I see a regression wherein pod install converts and leaves my project.pbxproj file sitting in XML property list format (rather than its original and Xcode-default ASCII property list format). This creates a huge, undiffable file in my working copy, _even if nothing has changed_.
According to this wiki entry, the problem was first identified some time ago and resolved in CocoaPods 0.24.0.
In the mean time, I can clean up by making a bogus or trivial change to project settings in order to instigate Xcode into re-writing the project file; following a no-change pod install this will effectively revert it back from XML to ASCII, cleaning my working copy. However, this act should be unnecessary.
You need the xcproj tool compiled with the Xcode version that you are using.
I don't believe I have ever installed such a tool, yet CocoaPods had been working flawlessly prior to now for over a year. Something changed by virtue of simply upgrading CocoaPods. There must be something else at play.
…well, having brew install xcproj and tried pod install again, the problem seems to be resolved. Perhaps I am just losing my mind.
From the xcproj readme:
The xcproj binary is bound to the Xcode version that compiled it. If you delete, move or rename the Xcode version that compiled the binary, xcproj will fail with the following error and explicit recovery suggestion:
Sounds like you upgraded to Xcode 6 which causes xcproj to break.
I think what's actually happening is that CocoaPods now re-writes the pbxproject every time, regardless of whether any material change is required. Heretofore (0.33 and earlier) an invocation of pod install against an already-configured project would never touch the project file.
Indeed, on new project setups, I probably was doing the manual Xcode-touch-to-convert thing without thinking about it; it wasn't a big deal, since as a project it was in flux anyway. Yet we often have the need to run pod install regularly (changing branches, etc.), and it was never a complication before 0.34.
I have never installed xcproj before today. Now it appears to be a requirement in order to maintain sanity when invoking pod install.
Ditto @zygoat's most recent comment. Never installed xcproj before and pod install always worked fine and didn't convert the project file to xml. Just discovered this now after recently updating cocoapods and then running agvtool only to find agvtool suddenly failing to parse the project.
So what's the solution to this without haven't to use home-brew to recompile a xctool?
@andrewtheis The solution is to install xcproj or ensure you edit your project file before you commit.
We (team ~10 devs) have the same issue since updating to CocoaPods 0.34.1. Pod install/update rewrites project file every time to XML format. This really annoys us since we moved to CocoaPods last month and not mastered it yet.
Ensuring that we edit project files before every commit is definitely not a solution. Do we really need to install xctool via brew (I don't know consequences of this by the way, so I'm afraid of it) or is there a chance that next CocoaPods release brings some fix to this issue?
@kurrak You definitely have to install xcproj.
I tested out CocoaPods 0.33 on a secondary machine and it always left the project files in the old PLIST format as well. I can only assume that Xcode 5.0 modified the project files itself maybe more frequently than Xcode 6 did so the issue never arose.
There's little implications on using the xcproj tool, it links internally to private Xcode frameworks and just triggers commands.
Furthermore it'd be important to tell your dev team that if they go to commit the pbxproj file and it looks like XML more than it looks like JSON that they need to get Xcode to re-write it by editing a build setting or something.
Ensuring that we edit project files before every commit is definitely not a solution. Do we really need to install xctool via brew (I don't know consequences of this by the way, so I'm afraid of it) or is there a chance that next CocoaPods release brings some fix to this issue?
Yes to all of the above.
Ok, thank you, I installed xcproj and it's fine.
Maybe I'm wrong but it seems like everybody should have this issue but only few have (based on current issue list). We'd be glad to help anyhow and provide any details about out setup etc. if its needed.
Our team of ~8 devs had the same issue. This is definitely a problem with CocoaPods. We were running Xcode 6 GM for a while before upgrading to CocoaPods 0.34.1 without this issue - and we never had installed xcproj previously.
@Kupczak You can install xcproj by downloading source from the GitHub project page and running the xcodebuild command on the README. This avoids the need to mess around with brew.
On Oct 7, 2014, at 7:14 AM, Maciek Kupczak [email protected] wrote:
We (team ~10 devs) have the same issue since updating to CocoaPods 0.34.1. Pod install/update rewrites project file every time to XML format. This really annoys us since we moved to CocoaPods last month and not mastered it yet.
Ensuring that we edit project files before every commit is definitely not a solution. Do we really need to install xctool via brew (I don't know consequences of this by the way, so I'm afraid of it) or is there a chance that next CocoaPods release brings some fix to this issue?—
Reply to this email directly or view it on GitHub.
As stated above, the problem always existed, but a bug in CP 0.34 makes it occur more often. It will be addressed in the future, but by using xcproj you can avoid it right now.
Hi again! I've just updated CocoaPods to 0.34.2 and run pod update. It crashes again. It is also connected with reading plists. I don't know if it's another issue, so I decided to post it here. I reinstalled xcproj and nothing changed.
Error:
Update all pods
Preparing
Analyzing dependencies
Updating spec repositories
$ /usr/bin/git rev-parse >/dev/null 2>&1
Updating spec repo `MCPods`
$ /usr/bin/git pull --ff-only
Already up-to-date.
$ /usr/bin/git rev-parse >/dev/null 2>&1
Updating spec repo `master`
$ /usr/bin/git pull --ff-only
Already up-to-date.
Inspecting targets to integrate
Using `ARCHS` setting to build architectures of target `Pods`: (``)
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/gems/2.0.0/gems/CFPropertyList-2.2.0/lib/rbCFPropertyList.rb:279: [BUG] Segmentation fault
ruby 2.0.0p451 (2014-02-24 revision 45167) [universal.x86_64-darwin13]
-- Crash Report log information --------------------------------------------
See Crash Report log file under the one of following:
* ~/Library/Logs/CrashReporter
* /Library/Logs/CrashReporter
* ~/Library/Logs/DiagnosticReports
* /Library/Logs/DiagnosticReports
the more detail of.
-- Control frame information -----------------------------------------------
c:0024 p:0057 s:0106 e:000104 METHOD /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/gems/2.0.0/gems/CFPropertyList-2.2.0/lib/rbCFPropertyList.r
c:0023 p:0021 s:0097 e:000096 METHOD /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/gems/2.0.0/gems/CFPropertyList-2.2.0/lib/rbCFPropertyList.r
c:0022 p:0071 s:0093 e:000092 METHOD /Library/Ruby/Gems/2.0.0/gems/xcodeproj-0.19.2/lib/xcodeproj/plist_helper.rb:60
c:0021 p:0030 s:0087 e:000086 METHOD /Library/Ruby/Gems/2.0.0/gems/xcodeproj-0.19.2/lib/xcodeproj/project.rb:175
c:0020 p:0070 s:0081 e:000080 METHOD /Library/Ruby/Gems/2.0.0/gems/xcodeproj-0.19.2/lib/xcodeproj/project.rb:92
c:0019 p:0035 s:0076 e:000075 BLOCK /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.2/lib/cocoapods/installer/analyzer.rb:542 [FINISH]
c:0018 p:---- s:0068 e:000067 CFUNC :each
c:0017 p:0011 s:0065 e:000064 BLOCK /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.2/lib/cocoapods/installer/analyzer.rb:539
c:0016 p:0082 s:0063 e:000062 METHOD /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.2/lib/cocoapods/user_interface.rb:49
c:0015 p:0015 s:0057 e:000056 METHOD /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.2/lib/cocoapods/installer/analyzer.rb:538
c:0014 p:0035 s:0054 e:000053 METHOD /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.2/lib/cocoapods/installer/analyzer.rb:50
c:0013 p:0108 s:0050 e:000049 METHOD /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.2/lib/cocoapods/installer.rb:184
c:0012 p:0007 s:0046 e:000045 BLOCK /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.2/lib/cocoapods/installer.rb:106
c:0011 p:0082 s:0044 e:000043 METHOD /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.2/lib/cocoapods/user_interface.rb:49
c:0010 p:0015 s:0038 e:000037 METHOD /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.2/lib/cocoapods/installer.rb:105
c:0009 p:0013 s:0035 e:000034 METHOD /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.2/lib/cocoapods/installer.rb:90
c:0008 p:0045 s:0032 e:000031 METHOD /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.2/lib/cocoapods/command/project.rb:71
c:0007 p:0145 s:0027 e:000026 METHOD /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.2/lib/cocoapods/command/project.rb:155
c:0006 p:0098 s:0022 e:000021 METHOD /Library/Ruby/Gems/2.0.0/gems/claide-0.7.0/lib/claide/command.rb:271
c:0005 p:0032 s:0016 e:000015 METHOD /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.2/lib/cocoapods/command.rb:48
c:0004 p:0257 s:0012 e:000011 TOP /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.2/bin/pod:33 [FINISH]
c:0003 p:---- s:0010 e:000009 CFUNC :load
c:0002 p:0118 s:0006 E:001de8 EVAL /usr/bin/pod:23 [FINISH]
c:0001 p:0000 s:0002 E:000bc8 TOP [FINISH]
Any ideas why it occurs?
@kurrak Please update xcodeproj this has been fixed already:
$ gem install xcodeproj
Thank you, it works!
This problem has returned.
Yosemite, ruby-2.1.3p242, cocoapods-0.35.0, xcodeproj-0.20.2, Xcode-6.2-beta2
Every time I run 'pod install' it rewrites my project file in XML plist format.
What is the new solution?
Yikes @bwhiteley! I'm running various rubies with cocoapods 0.35, xcodeproj 0.20.2, and Xcode 6.1.1 fine. Not ready to make the leap to Xcode 6.2 anything yet.
I've just installed xcproj to get around this issue, but unfortunately this still doesn't result in a usable diff. Sure, the project file remains in ASCII format but all the IDs have changed and things have moved around to such an extent that the diff, although being between two ASCII files, shows differences on practically every line of the file.
@erikjalevik We're fully aware of this, the xcproj is mostly to keep your application project file consistent. The Pods.xcproj indeed changes the UUID's, there are a couple of open issues to prevent this:
There is even an open-pull request for this: https://github.com/CocoaPods/Xcodeproj/pull/185
Is xcproj still needed nowadays or are there better ways now?
@kylef I noticed when using use_frameworks! and doing a pod install, even when xcproj is installed, the project file will still be written in xml. Are there any workarounds for that? Both the Pods and my client project file are affected.
EDIT: Ah ok, when using the newest 1.0.0 beta then it works correctly.
I've got the following case:
Xcode 7.2, CocoaPods 0.39.0 - $ pod install leaves the .pbxproject in ASCII plist format
Xcode 7.2, CocoaPods 1.0.0-beta7 - $ pod install leaves the .pbxproject in ASCII plist format
Xcode 7.3, CocoaPods 0.39.0 - $ pod install leaves the .pbxproject in _XML plist format_
Xcode 7.3, CocoaPods 1.0.0-beta7 - $ pod install leaves the .pbxproject in ASCII plist format
Installing xcproj and adding it to path doesn't seem to fix the Xcode 7.3, CocoaPods 0.39.0 issue. As the 1.0.0-beta7 behaves correctly I'm guessing a patch will be issued for 0.39.0?
Tested both with and without use_frameworks!
@kylef any thoughts on this?
@Mitko-Kerezov please don't comment three hours after your last comment with "why haven't you responded to me" comments like this, it's not polite. People will get around to things that they work on in their spare time, when they do.
@orta The comment was not meant to push anyone rather than to raise awareness. This issue is closed after all - not everyone checks up on closed issues
I don't mean to offend anyone
No, we won't be patching pre-1.0 since Xcode 7.3 support is a feature and 1.0 final is very close.
I can convert the format by running xcproj touch in Terminal.
so adding system 'xcproj touch' at the end of the Podfile seems work for me
Most helpful comment
I've got the following case:
Xcode 7.2, CocoaPods 0.39.0 -
$ pod installleaves the.pbxprojectin ASCII plist formatXcode 7.2, CocoaPods 1.0.0-beta7 -
$ pod installleaves the.pbxprojectin ASCII plist formatXcode 7.3, CocoaPods 0.39.0 -
$ pod installleaves the.pbxprojectin _XML plist format_Xcode 7.3, CocoaPods 1.0.0-beta7 -
$ pod installleaves the.pbxprojectin ASCII plist formatInstalling
xcprojand adding it to path doesn't seem to fix the Xcode 7.3, CocoaPods 0.39.0 issue. As the1.0.0-beta7behaves correctly I'm guessing a patch will be issued for 0.39.0?Tested both with and without
use_frameworks!