pod发生了什么?

时间:2018-04-21 05:42:28

标签: ios xcode cocoapods pod

这是我的Podfile

# Uncomment this line to define a global platform for your project
# platform :ios, '10.0'
# Pods for BandUJam
target 'BandUJam' do
    pod 'Masonry'
    pod 'SDWebImage'
    pod 'VODUpload'
    pod "AFNetworking",'~> 3.1.0' 
    pod "SDWebImage" 
    pod "UMengUShare/Social/WeChat"
    pod 'AliyunPlayer_iOS'
    pod 'Toast', '~> 4.0.0'
        pod 'UITextView+Placeholder', '~> 1.2'
end

当我" pod安装"或者" pod update"

然后在终端

中收到此消息
Analyzing dependencies

――― MARKDOWN TEMPLATE ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

### Command

```
/usr/local/bin/pod install
```

### Report

* What did you do?

* What did you expect to happen?

* What happened instead?


### Stack

```
   CocoaPods : 1.3.1
        Ruby : ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-darwin17]
    RubyGems : 2.6.14
        Host : Mac OS X 10.13.4 (17E199)
       Xcode : 9.3 (9E145)
         Git : git version 2.15.1 (Apple Git-101)
Ruby lib dir : /usr/local/Cellar/ruby/2.4.2_1/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ 90a8f1374ef5378bc8a55c5a4e4a19eb92385907
```

### Plugins

```
cocoapods-deintegrate : 1.0.1
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

```ruby
# Uncomment this line to define a global platform for your project
# platform :ios, '10.0'
# Pods for BandUJam
target 'BandUJam' do
    pod 'Masonry'
    pod 'SDWebImage'
    pod 'VODUpload'
    pod "AFNetworking",'~> 3.1.0' 
    pod "SDWebImage" 
    pod "UMengUShare/Social/WeChat"
    pod 'AliyunPlayer_iOS'
    pod 'Toast', '~> 4.0.0'
        pod 'UITextView+Placeholder', '~> 1.2'
end
```

### Error

```
RuntimeError - [Xcodeproj] Unknown object version.
/usr/local/lib/ruby/gems/2.4.0/gems/xcodeproj-1.5.3/lib/xcodeproj/project.rb:217:in `initialize_from_file'
/usr/local/lib/ruby/gems/2.4.0/gems/xcodeproj-1.5.3/lib/xcodeproj/project.rb:102:in `open'
/usr/local/lib/ruby/gems/2.4.0/gems/cocoapods-1.3.1/lib/cocoapods/installer/analyzer.rb:903:in `block (2 levels) in inspect_targets_to_integrate'
/usr/local/lib/ruby/gems/2.4.0/gems/cocoapods-1.3.1/lib/cocoapods/installer/analyzer.rb:902:in `each'
/usr/local/lib/ruby/gems/2.4.0/gems/cocoapods-1.3.1/lib/cocoapods/installer/analyzer.rb:902:in `block in inspect_targets_to_integrate'
/usr/local/lib/ruby/gems/2.4.0/gems/cocoapods-1.3.1/lib/cocoapods/user_interface.rb:64:in `section'
/usr/local/lib/ruby/gems/2.4.0/gems/cocoapods-1.3.1/lib/cocoapods/installer/analyzer.rb:897:in `inspect_targets_to_integrate'
/usr/local/lib/ruby/gems/2.4.0/gems/cocoapods-1.3.1/lib/cocoapods/installer/analyzer.rb:69:in `analyze'
/usr/local/lib/ruby/gems/2.4.0/gems/cocoapods-1.3.1/lib/cocoapods/installer.rb:242:in `analyze'
/usr/local/lib/ruby/gems/2.4.0/gems/cocoapods-1.3.1/lib/cocoapods/installer.rb:154:in `block in resolve_dependencies'
/usr/local/lib/ruby/gems/2.4.0/gems/cocoapods-1.3.1/lib/cocoapods/user_interface.rb:64:in `section'
/usr/local/lib/ruby/gems/2.4.0/gems/cocoapods-1.3.1/lib/cocoapods/installer.rb:153:in `resolve_dependencies'
/usr/local/lib/ruby/gems/2.4.0/gems/cocoapods-1.3.1/lib/cocoapods/installer.rb:116:in `install!'
/usr/local/lib/ruby/gems/2.4.0/gems/cocoapods-1.3.1/lib/cocoapods/command/install.rb:41:in `run'
/usr/local/lib/ruby/gems/2.4.0/gems/claide-1.0.2/lib/claide/command.rb:334:in `run'
/usr/local/lib/ruby/gems/2.4.0/gems/cocoapods-1.3.1/lib/cocoapods/command.rb:52:in `run'
/usr/local/lib/ruby/gems/2.4.0/gems/cocoapods-1.3.1/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/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] [12 comments]
   a week ago

 - RuntimeError - [Xcodeproj] Unknown object version.
   https://github.com/CocoaPods/CocoaPods/issues/6992 [closed] [12 comments]
   a week ago

 - RuntimeError - [Xcodeproj] Unknown object version.
   https://github.com/CocoaPods/CocoaPods/issues/6991 [closed] [11 comments]
   03 Feb 2018

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

我在终端

尝试了这个
cd ~/.cocoapods/repos
rm -rf master
pod setup

仍在终端

中收到此消息

如何解决?非常感谢你!

enter image description here

5 个答案:

答案 0 :(得分:10)

您需要运行此Sudo gem install cocoapods --pre 请检查此报告的问题https://github.com/CocoaPods/CocoaPods/issues/7458

答案 1 :(得分:4)

如果您正在使用 xCode版本9.4 并创建新项目,则会发现此问题, 要解决此问题,请将项目格式更改为与xCode8.0兼容

enter image description here

答案 2 :(得分:3)

通过以下方式检查xcodeproj gem版本:

gem list

如果低于1.5.6,请使用以下命令进行更新:

gem update xcodeproj

更新完成后,您可以使用以下命令删除旧版本:

gem uninstall xcodeproj

选择旧版本。

希望这会有所帮助!

答案 3 :(得分:0)

使用上面的这些pod(BandU的#Pods)并保存您的文件。然后再次安装并更新您的pod。它会起作用。

这些是现在使用的正确框架:

pod 'Masonry'
pod 'SDWebImage'
pod 'Aliyun VideoCore'
pod 'AliyunOSSiOS'
pod 'VODUpload'
pod 'AFNetworking'
pod 'UMengUShare/Social/WeChat'
pod 'Toast'
pod 'UITextView+Placeholder'

希望它会对你有所帮助。

答案 4 :(得分:0)

gem install cocoapods --pre --user

为我解决了这个问题