1. 程式人生 > >升級Xcode9.3後 cocoapods 無法使用的解決辦法

升級Xcode9.3後 cocoapods 無法使用的解決辦法

### Error

```

RuntimeError - [Xcodeproj] Unknown object version.

/Users/junyangyang/.rvm/gems/ruby-2.2.2@global/gems/xcodeproj-1.4.2/lib/xcodeproj/project.rb:217:in `initialize_from_file'

/Users/junyangyang/.rvm/gems/ruby-2.2.2@global/gems/xcodeproj-1.4.2/lib/xcodeproj/project.rb:102:in `open'

/Users/junyangyang/.rvm/gems/ruby-2.2.2@global/gems/cocoapods-1.2.0/lib/cocoapods/installer/analyzer.rb:851:in `block (2 levels) in inspect_targets_to_integrate'

/Users/junyangyang/.rvm/gems/ruby-2.2.2@global/gems/cocoapods-1.2.0/lib/cocoapods/installer/analyzer.rb:850:in `each'

/Users/junyangyang/.rvm/gems/ruby-2.2.2@global/gems/cocoapods-1.2.0/lib/cocoapods/installer/analyzer.rb:850:in `block in inspect_targets_to_integrate'

/Users/junyangyang/.rvm/gems/ruby-2.2.2@global/gems/cocoapods-1.2.0/lib/cocoapods/user_interface.rb:64:in `section'

/Users/junyangyang/.rvm/gems/ruby-2.2.2@global/gems/cocoapods-1.2.0/lib/cocoapods/installer/analyzer.rb:845:in `inspect_targets_to_integrate'

/Users/junyangyang/.rvm/gems/ruby-2.2.2@global/gems/cocoapods-1.2.0/lib/cocoapods/installer/analyzer.rb:66:in `analyze'

/Users/junyangyang/.rvm/gems/ruby-2.2.2@global/gems/cocoapods-1.2.0/lib/cocoapods/installer.rb:236:in `analyze'

/Users/junyangyang/.rvm/gems/ruby-2.2.2@global/gems/cocoapods-1.2.0/lib/cocoapods/installer.rb:150:in `block in resolve_dependencies'

/Users/junyangyang/.rvm/gems/ruby-2.2.2@global/gems/cocoapods-1.2.0/lib/cocoapods/user_interface.rb:64:in `section'

/Users/junyangyang/.rvm/gems/ruby-2.2.2@global/gems/cocoapods-1.2.0/lib/cocoapods/installer.rb:149:in `resolve_dependencies'

/Users/junyangyang/.rvm/gems/ruby-2.2.2@global/gems/cocoapods-1.2.0/lib/cocoapods/installer.rb:110:in `install!'

/Users/junyangyang/.rvm/gems/ruby-2.2.2@global/gems/cocoapods-1.2.0/lib/cocoapods/command/install.rb:37:in `run'

/Users/junyangyang/.rvm/gems/ruby-2.2.2@global/gems/claide-1.0.1/lib/claide/command.rb:334:in `run'

/Users/junyangyang/.rvm/gems/ruby-2.2.2@global/gems/cocoapods-1.2.0/lib/cocoapods/command.rb:52:in `run'

/Users/junyangyang/.rvm/gems/ruby-2.2.2@global/gems/cocoapods-1.2.0/bin/pod:55:in `<top (required)>'

/Users/junyangyang/.rvm/gems/ruby-2.2.2@global/bin/pod:23:in `load'

/Users/junyangyang/.rvm/gems/ruby-2.2.2@global/bin/pod:23:in `<main>'

```

――― TEMPLATE END ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

[!] Oh no, an error occurred.

Search for existing GitHub issues similar to yours:

https://github.com/CocoaPods/CocoaPods/search?q=%5BXcodeproj%5D+Unknown+object+version.&type=Issues

If none exists, create a ticket, with the template displayed above, on:

https://github.com/CocoaPods/CocoaPods/issues/new

Be sure to first read the contributing guide for details on how to properly submit a ticket:

https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md

Don't forget to anonymize any private data!

Looking for related issues on cocoapods/cocoapods...

 - RuntimeError - [Xcodeproj] Unknown object version.

   https://github.com/CocoaPods/CocoaPods/issues/7458 [closed] [11 comments]

   a day ago

 - RuntimeError - [Xcodeproj] Unknown object version.

   https://github.com/CocoaPods/CocoaPods/issues/6992 [closed] [11 comments]

   3 days ago

 - RuntimeError - [Xcodeproj] Unknown object version.

   https://github.com/CocoaPods/CocoaPods/issues/6991 [closed] [11 comments]

   03 Feb 2018

and 31 more at:

https://github.com/cocoapods/cocoapods/search?q=[Xcodeproj]%20Unknown%20object%20version.&type=Issues&utf8=✓

解決辦法是升級升級cocoapods:gem install cocoapods --pre