说明:在终端使用pod install
时,一直添加不成功
终端提示
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.3.3p222 (2016-11-21 revision 56859) [universal.x86_64-darwin17]
RubyGems : 2.6.13
Host : Mac OS X 10.13.5 (17F77)
Xcode : 9.2 (9C40b)
Git : git version 2.14.3 (Apple Git-98)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ 706f947a26aacddd63fb00ad42f5ee5fa35d07b7
WNSepcs - https://gitee.com/studyofwunan/WNSepcs.git @ a9e126e323b68c3006776f68e66eb7f110059acb
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
platform :ios, '8.0'
use_frameworks!
target 'SwiftTableView' do
pod 'SDWebImage'
pod 'AFNetworking'
end
#注释:swift的pod文件在于use_frameworks! 这一句是必须的,作用是把三方库打包成静态库,而oc是不需要的
# 使用:1、General --> Linked Frameworks and Libraries 2、导入头文件
Error
RuntimeError - [Xcodeproj] Unknown object version.
/Library/Ruby/Gems/2.3.0/gems/xcodeproj-1.5.2/lib/xcodeproj/project.rb:217:in `initialize_from_file'
/Library/Ruby/Gems/2.3.0/gems/xcodeproj-1.5.2/lib/xcodeproj/project.rb:102:in `open'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.3.1/lib/cocoapods/installer/analyzer.rb:903:in `block (2 levels) in inspect_targets_to_integrate'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.3.1/lib/cocoapods/installer/analyzer.rb:902:in `each'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.3.1/lib/cocoapods/installer/analyzer.rb:902:in `block in inspect_targets_to_integrate'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.3.1/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.3.1/lib/cocoapods/installer/analyzer.rb:897:in `inspect_targets_to_integrate'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.3.1/lib/cocoapods/installer/analyzer.rb:69:in `analyze'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.3.1/lib/cocoapods/installer.rb:242:in `analyze'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.3.1/lib/cocoapods/installer.rb:154:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.3.1/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.3.1/lib/cocoapods/installer.rb:153:in `resolve_dependencies'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.3.1/lib/cocoapods/installer.rb:116:in `install!'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.3.1/lib/cocoapods/command/install.rb:41:in `run'
/Library/Ruby/Gems/2.3.0/gems/claide-1.0.2/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.3.1/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.3.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>'
Github 上提供的相似问题集合
[!] 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...
-
Pod init. Unknown object version
https://github.com/CocoaPods/CocoaPods/issues/7907 [closed] [2 comments]
2 weeks ago -
RuntimeError - [Xcodeproj] Unknown object version.
https://github.com/CocoaPods/CocoaPods/issues/7697 [closed] [27 comments]
5 days ago -
Unknown object version
https://github.com/CocoaPods/CocoaPods/issues/7760 [closed] [1 comment]
21 May 2018
and 41 more at:
https://github.com/cocoapods/cocoapods/search?q=[Xcodeproj]%20Unknown%20object%20version.&type=Issues&utf8=✓
原因
我的电脑中有2个Xcode软件,使用Xcode 10的版本,创建的项目默认Project Format 9.3,而系统链接的Xcode是 9.2,如上面的Stack
如何解决
Project Format 调低
Project Format 调低
网友评论