Cocoapods: pod init crash

Created on 28 Jan 2018  路  18Comments  路  Source: CocoaPods/CocoaPods

Report

What did you do?

Tried to run pod init

What did you expect to happen?

A Podfile should've gotten created in the directory.

What happened instead?

An error occured

CocoaPods Environment

   CocoaPods : 1.4.0
        Ruby : ruby 2.3.3p222 (2016-11-21 revision 56859) [universal.x86_64-darwin17]
    RubyGems : 2.5.2
        Host : Mac OS X 10.13.4 (17E139j)
       Xcode : 9.3 (9Q98q)
         Git : git version 2.15.1 (Apple Git-101)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ 9d4a38066eee060f00217d6e6786c3e6715e1403

Plugins

cocoapods-deintegrate : 1.0.2
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.0.0
cocoapods-trunk       : 1.3.0
cocoapods-try         : 1.1.0

Podfile

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'Customise Test' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!
  inhibit_all_warnings!

  # Pods for Customise Test

pod "ElasticTransition"

end

Error

RuntimeError - [Xcodeproj] Unknown object version.
/Library/Ruby/Gems/2.3.0/gems/xcodeproj-1.5.4/lib/xcodeproj/project.rb:217:in `initialize_from_file'
/Library/Ruby/Gems/2.3.0/gems/xcodeproj-1.5.4/lib/xcodeproj/project.rb:102:in `open'
/Users/chaitanya/.gem/ruby/2.3.0/gems/cocoapods-1.4.0/lib/cocoapods/command/init.rb:41:in `validate!'
/Library/Ruby/Gems/2.3.0/gems/claide-1.0.2/lib/claide/command.rb:333:in `run'
/Users/chaitanya/.gem/ruby/2.3.0/gems/cocoapods-1.4.0/lib/cocoapods/command.rb:52:in `run'
/Users/chaitanya/.gem/ruby/2.3.0/gems/cocoapods-1.4.0/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:22:in `load'
/usr/local/bin/pod:22:in `<main>'

Most helpful comment

@mattmega4 $ sudo gem install xcodeproj

All 18 comments

Works for me. Seems like you are also on Xcode 9.3, can you please try using Xcodeproj from master using http://bundler.io/?

This might already be fixed by https://github.com/CocoaPods/Xcodeproj/pull/541

I'm still facing the same issue.

@chaitanya-ramji can you please provide a sample app although I am doubtful I will able to reproduce this.

Hi there @dnkoutso, i am having the very same issue as @chaitanya-ramji. Here is a sample app i created for demonstration purposes. Please let me know if there is anything else you would like me to send along or try.

Hi,
Same issue here. I just created an ARKit project with Xcode 9.3.
It doesn't happen if I create it with Xcode 9.2.

has anyone actually confirmed that trying the above (latest xcodeproj gem) works?

I need to install 9.3 beta 1

Hi @dnkoutso, i have never used the xcodeproj bundler before. I am having a hard time understanding the docs. I was using 9.3 beta, will try again with 9.2

Update- it worked fine when i tried with 9.2

I reproduced the issue and confirmed that changing the source build to the latest Xcodeproj fixes the issue. However, it looks like CocoaPods 1.4.0 is still pointing at Xcodeproj 1.5.4 which was made before the fix.

~/Cocoapods/CocoaPods (master) $ git diff

diff --git a/Gemfile b/Gemfile
index a91ebb2b..d666caf9 100644
--- a/Gemfile
+++ b/Gemfile
@@ -35,7 +35,7 @@ group :development do
   cp_gem 'cocoapods-try',         'cocoapods-try'
   cp_gem 'molinillo',             'Molinillo'
   cp_gem 'nanaimo',               'Nanaimo'
-  cp_gem 'xcodeproj',             'Xcodeproj'
+  cp_gem 'xcodeproj',             'Xcodeproj', path:true`

Yes, this is because Xcode 9.3 Beta 1 was not released when we released 1.4.0.

I think this issue should be closed since its fixed and it will ship with next release (1.4.1 or 1.5.0.beta.1)

I'll release Xcodeproj 1.5.5 when I get home, which will fix this

How do I get the correct version of CocoaPods ? I am still getting 1.4

@mattmega4 $ sudo gem install xcodeproj

cocoapods is a different gem than xcodeproj. There was a release of xcodeproj to 1.5.5 not of cocoapods which is still in 1.4.0 as of this comment.

So update the xcodeproj gem should hopefully fix your issue.

I think we can close this with Xcodeproj 1.5.5 and 1.5.6 releases, @segiddins ?

Yup!

i had same issue and fixed by using "$ sudo gem install xcodeproj"

Still not able to fix the error, can someone please contribute???

Thanks a lot!!!

@HarshitG24 The fix was already contributed. See the comments above about how to update your installation to pick up the fix.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gerchicov-bp picture gerchicov-bp  路  3Comments

soleares picture soleares  路  3Comments

lzwjava picture lzwjava  路  3Comments

intelliot picture intelliot  路  3Comments

marzapower picture marzapower  路  3Comments