在项目xcworkspace中新增一个project,Podfile写好新分支的target
target 'heNanXinXiang' do
platform :ios, '8.0'
project 'heNanXinXiang/heNanXinXiang.xcodeproj'
pod 'MJRefresh'
pod 'MBProgressHUD'
pod 'SDWebImage'
pod 'FMDB'
pod 'TYKYLibrary'
pod 'Bugly'
pod 'UMCShare/Social/ReducedWeChat'
pod 'JPush'
end
项目也设置好支持最低版本支持
但是运行的时候会出现以下的错误,为了详细。。。 这里全部列出来
### Command
/Users/tjsoft/.rvm/rubies/ruby-2.2.0/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.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin14]
RubyGems : 2.6.7
Host : Mac OS X 10.13.5 (17F77)
Xcode : 9.4.1 (9F2000)
Git : git version 2.15.2 (Apple Git-101.1)
Ruby lib dir : /Users/tjsoft/.rvm/rubies/ruby-2.2.0/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ bb1ecc39b9f60055d2b89572fe141aec6a3b5476
### Plugins
cocoapods-deintegrate : 1.0.1
cocoapods-plugins : 1.0.0
cocoapods-search : 1.0.0
cocoapods-stats : 1.0.0
cocoapods-trunk : 1.2.0
cocoapods-try : 1.1.0
### Podfile
```ruby
workspace 'TYKYOnlineWall_iOS.xcworkspace'
target 'TYKYWallBaseSDK' do
platform :ios, '8.0'
project 'TYKYWallBaseSDK/TYKYWallBaseSDK.xcodeproj'
pod 'MJRefresh'
pod 'MBProgressHUD'
pod 'SDWebImage'
pod 'FMDB'
pod 'TYKYLibrary'
pod 'Bugly'
pod 'UMCShare/Social/ReducedWeChat'
# pod 'UMengAnalytics-NO-IDFA'
pod 'JPush'
end
target 'kaiFengZiMaoQu2.0' do
platform :ios, '8.0'
project 'kaiFengZiMaoQu2.0/kaiFengZiMaoQu2.0.xcodeproj'
pod 'MJRefresh'
pod 'MBProgressHUD'
pod 'SDWebImage'
pod 'FMDB'
pod 'TYKYLibrary','1.4.5'
pod 'Bugly'
pod 'ZFPlayer'
pod 'UMCShare/Social/ReducedWeChat'
# pod 'UMengAnalytics-NO-IDFA'
pod 'JPush'
end
target 'nanYang' do
platform :ios, '8.0'
project 'nanYang/nanYang.xcodeproj'
pod 'MJRefresh'
pod 'MBProgressHUD'
pod 'SDWebImage'
pod 'FMDB'
pod 'TYKYLibrary','1.4.5'
pod 'Bugly'
pod 'UMCShare/Social/ReducedWeChat'
pod 'JPush'
end
target 'huNanLiuYangJingKai' do
platform :ios, '8.0'
project 'huNanLiuYangJingKai/huNanLiuYangJingKai.xcodeproj'
pod 'MJRefresh'
pod 'MBProgressHUD'
pod 'SDWebImage'
pod 'FMDB'
pod 'TYKYLibrary','1.4.5'
pod 'Bugly'
pod 'UMCShare/Social/ReducedWeChat'
pod 'JPush'
end
### Error
RuntimeError - [Xcodeproj] Unknown object version.
/Users/tjsoft/.rvm/gems/ruby-2.2.0@global/gems/xcodeproj-1.5.1/lib/xcodeproj/project.rb:217:in `initialize_from_file'
/Users/tjsoft/.rvm/gems/ruby-2.2.0@global/gems/xcodeproj-1.5.1/lib/xcodeproj/project.rb:102:in `open'
/Users/tjsoft/.rvm/gems/ruby-2.2.0@global/gems/cocoapods-1.3.1/lib/cocoapods/installer/analyzer.rb:903:in `block (2 levels) in inspect_targets_to_integrate'
/Users/tjsoft/.rvm/gems/ruby-2.2.0@global/gems/cocoapods-1.3.1/lib/cocoapods/installer/analyzer.rb:902:in `each'
/Users/tjsoft/.rvm/gems/ruby-2.2.0@global/gems/cocoapods-1.3.1/lib/cocoapods/installer/analyzer.rb:902:in `block in inspect_targets_to_integrate'
/Users/tjsoft/.rvm/gems/ruby-2.2.0@global/gems/cocoapods-1.3.1/lib/cocoapods/user_interface.rb:64:in `section'
/Users/tjsoft/.rvm/gems/ruby-2.2.0@global/gems/cocoapods-1.3.1/lib/cocoapods/installer/analyzer.rb:897:in `inspect_targets_to_integrate'
/Users/tjsoft/.rvm/gems/ruby-2.2.0@global/gems/cocoapods-1.3.1/lib/cocoapods/installer/analyzer.rb:69:in `analyze'
/Users/tjsoft/.rvm/gems/ruby-2.2.0@global/gems/cocoapods-1.3.1/lib/cocoapods/installer.rb:242:in `analyze'
/Users/tjsoft/.rvm/gems/ruby-2.2.0@global/gems/cocoapods-1.3.1/lib/cocoapods/installer.rb:154:in `block in resolve_dependencies'
/Users/tjsoft/.rvm/gems/ruby-2.2.0@global/gems/cocoapods-1.3.1/lib/cocoapods/user_interface.rb:64:in `section'
/Users/tjsoft/.rvm/gems/ruby-2.2.0@global/gems/cocoapods-1.3.1/lib/cocoapods/installer.rb:153:in `resolve_dependencies'
/Users/tjsoft/.rvm/gems/ruby-2.2.0@global/gems/cocoapods-1.3.1/lib/cocoapods/installer.rb:116:in `install!'
/Users/tjsoft/.rvm/gems/ruby-2.2.0@global/gems/cocoapods-1.3.1/lib/cocoapods/command/install.rb:41:in `run'
/Users/tjsoft/.rvm/gems/ruby-2.2.0@global/gems/claide-1.0.2/lib/claide/command.rb:334:in `run'
/Users/tjsoft/.rvm/gems/ruby-2.2.0@global/gems/cocoapods-1.3.1/lib/cocoapods/command.rb:52:in `run'
/Users/tjsoft/.rvm/gems/ruby-2.2.0@global/gems/cocoapods-1.3.1/bin/pod:55:in `<top (required)>'
/Users/tjsoft/.rvm/rubies/ruby-2.2.0/bin/pod:22:in `load'
/Users/tjsoft/.rvm/rubies/ruby-2.2.0/bin/pod:22:in `<main>'
/Users/tjsoft/.rvm/gems/ruby-2.2.0@global/bin/ruby_executable_hooks:15:in `eval'
/Users/tjsoft/.rvm/gems/ruby-2.2.0@global/bin/ruby_executable_hooks:15: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/7697 [closed] [22 comments]
5 days ago
- Unknown object version
https://github.com/CocoaPods/CocoaPods/issues/7760 [closed] [1 comment]
5 weeks ago
- RuntimeError - [Xcodeproj] Unknown object version. 🌈
https://github.com/CocoaPods/CocoaPods/issues/7712 [closed] [9 comments]
07 May 2018
and 40 more at:
https://github.com/cocoapods/cocoapods/search?q=[Xcodeproj]%20Unknown%20object%20version.&type=Issues&utf8=✓
刚开始没有注意看,一看到错误就直接谷歌和百度,给出的方法,是升级cocoPod版本。
sudo rm -fr ~/.cocoapods/repos/master
pod setup
但是我这种情况还是不行。在仔细查看错误,其实cocoaPod最后有列出跟这个问题接近的issues,在https://github.com/CocoaPods/CocoaPods/issues/7697 这个issues中找到了解决方案。
Xcode9.3版本之后,创建新的project文件,这里会自动设置为Xcode 9.3 - compatible
将Projece Format 修改为 Xcode 8.0 - compatible 即可。
Projece Format 设置project的文件格式,当我们设置为Xcode 9.3 - compatible的时候,使用9.3以下版本Xcode是无法打开。应该是三方库的project文件低于9.3的时候,cocoaPod会出现错误(如果理解不到位,麻烦大佬指出)
问题记录下。