iOS:升级Xcode9.3后cocoapods update 失败

升级Xcode9.3后cocoapods update 错误如下:

### Error

```

RuntimeError - [Xcodeproj] Unknown object version.

/Users/UserName/.rvm/gems/ruby-2.2.2/gems/xcodeproj-1.5.2/lib/xcodeproj/project.rb:217:in `initialize_from_file'

/Users/UserName/.rvm/gems/ruby-2.2.2/gems/xcodeproj-1.5.2/lib/xcodeproj/project.rb:102:in `open'

/Users/UserName/.rvm/gems/ruby-2.2.2/gems/cocoapods-1.3.1/lib/cocoapods/installer/analyzer.rb:903:in `block (2 levels) in inspect_targets_to_integrate'

/Users/UserName/.rvm/gems/ruby-2.2.2/gems/cocoapods-1.3.1/lib/cocoapods/installer/analyzer.rb:902:in `each'

/Users/UserName/.rvm/gems/ruby-2.2.2/gems/cocoapods-1.3.1/lib/cocoapods/installer/analyzer.rb:902:in `block in inspect_targets_to_integrate'

/Users/UserName/.rvm/gems/ruby-2.2.2/gems/cocoapods-1.3.1/lib/cocoapods/user_interface.rb:64:in `section'

/Users/UserName/.rvm/gems/ruby-2.2.2/gems/cocoapods-1.3.1/lib/cocoapods/installer/analyzer.rb:897:in `inspect_targets_to_integrate'

/Users/UserName/.rvm/gems/ruby-2.2.2/gems/cocoapods-1.3.1/lib/cocoapods/installer/analyzer.rb:69:in `analyze'

/Users/UserName/.rvm/gems/ruby-2.2.2/gems/cocoapods-1.3.1/lib/cocoapods/installer.rb:242:in `analyze'

/Users/UserName/.rvm/gems/ruby-2.2.2/gems/cocoapods-1.3.1/lib/cocoapods/installer.rb:154:in `block in resolve_dependencies'

/Users/UserName/.rvm/gems/ruby-2.2.2/gems/cocoapods-1.3.1/lib/cocoapods/user_interface.rb:64:in `section'

/Users/UserName/.rvm/gems/ruby-2.2.2/gems/cocoapods-1.3.1/lib/cocoapods/installer.rb:153:in `resolve_dependencies'

/Users/UserName/.rvm/gems/ruby-2.2.2/gems/cocoapods-1.3.1/lib/cocoapods/installer.rb:116:in `install!'

/Users/UserName/.rvm/gems/ruby-2.2.2/gems/cocoapods-1.3.1/lib/cocoapods/command/update.rb:81:in `run'

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

/Users/UserName/.rvm/gems/ruby-2.2.2/gems/cocoapods-1.3.1/lib/cocoapods/command.rb:52:in `run'

/Users/UserName/.rvm/gems/ruby-2.2.2/gems/cocoapods-1.3.1/bin/pod:55:in `'

解决方案:

升级cocoapods:gem install cocoapods --pre



后续补充:

有简友发现使用上述方法未能成功,如果你的问题依然没有解决,不妨检查一下XCode工程Project下的如下配置:


iOS:升级Xcode9.3后cocoapods update 失败_第1张图片
Project配置

这里的Project Format 默认为Xcode 9.3-compatible,将它修改9.3以下即可。

感谢@白日今口分享上述解决方案

原文地址:https://www.jianshu.com/p/8de9279522f3

你可能感兴趣的:(iOS:升级Xcode9.3后cocoapods update 失败)