记录一个cocoapods bug吧

这个错误是目前 CocoaPods 1.16.x 在 Xcode 16 / Xcodeproj 新版本工程(objectVersion = 70) 上的已知兼容性问题。
问题:

apple@king-Mac-mini XingDongDemo % pod install
Analyzing dependencies
Downloading dependencies
Installing ZLPhotoBrowser (4.7.3)
Generating Pods project

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

### Command

```
/Users/apple/.rbenv/versions/3.2.2/bin/pod install
```

### Report

* What did you do?

* What did you expect to happen?

* What happened instead?


### Stack

```
   CocoaPods : 1.16.2
        Ruby : ruby 3.2.2 (2023-03-30 revision e51014f9c0) [arm64-darwin24]
    RubyGems : 3.7.2
        Host : macOS 26.1 (25B78)
       Xcode : 16.4 (16F6)
         Git : git version 2.39.5 (Apple Git-154)
Ruby lib dir : /Users/apple/.rbenv/versions/3.2.2/lib
Repositories : trunk - CDN - https://cdn.cocoapods.org/
```

### Plugins

```
cocoapods-deintegrate : 1.0.5
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.1
cocoapods-trunk       : 1.6.0
cocoapods-try         : 1.2.0
```

### Podfile

```ruby
# Uncomment the next line to define a global platform for your project
 platform :ios, '11.0'

##腾讯云短视频sdk
install! 'cocoapods', :disable_input_output_paths => true
#install!'cocoapods',:deterministic_uuids=>false


# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
 



target 'XingDongDemo' do
 

 pod 'ZLPhotoBrowser' #图片预览
 
  pod 'GTSDK', '2.6.9.0-noidfa' #xxxx代表当前最新版本号

  # Pods for XingDongDemo
  pod 'AFNetworking'
  pod 'SDWebImage'
  pod 'MJExtension'
  pod 'SVProgressHUD'
  pod 'MJRefresh'
  pod 'Masonry'
  pod 'IQKeyboardManager'
  pod 'MBProgressHUD'
  pod 'YYKit'
  pod 'WechatOpenSDK'
  pod 'SJVideoPlayer'
  pod 'YYModel'
  pod 'SnapKit' #swift 布局 库
   
#  pod 'NEConversationUIKit', '9.3.0' #会话列表组件
#  pod 'NEChatUIKit', '9.3.0'         #单聊群聊组件
 
 #可选Kit库(和UIKit对应)
 pod 'NEConversationKit', '9.3.0'
 pod 'NEChatKit', '9.3.0'
 
 #基础kit库
 pod 'NECommonUIKit', '9.3.0'
 pod 'NECommonKit', '9.3.0'
 pod 'NECoreIMKit', '9.3.0'
 pod 'NECoreKit', '9.3.0'
 
 # 如果需要查看UI部分源码请注释掉以上在线依赖,打开下面的本地依赖[内部源码 有改动,重新pod 请备份]
 pod 'NEConversationUIKit', :path => 'NEConversationUIKit/NEConversationUIKit.podspec'
 pod 'NEChatUIKit', :path => 'NEChatUIKit/NEChatUIKit.podspec'

 
  ##腾讯云短视频sdk [内部源码 有改动,重新pod 请备份]
 pod 'BeautySettingKit', :path => 'BeautySettingKit/BeautySettingKit.podspec'
 pod 'xmagickit', :path => 'xmagickit/xmagickit.podspec'
 pod 'QCloudQuic/Slim','6.0.5'
 pod 'UGCKit', :path => 'UGCKit/UGCKit.podspec', :subspecs => ["UGC"]   #subspecs 根据SDK来选择


end

 

##⚠️如果pod依赖报错,可打开以下注释
#post_install do |installer|
#  installer.pods_project.targets.each do |target|
#    target.build_configurations.each do |config|
#      config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'NO'
#    end
#  end
#end


post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      if config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'].to_f < 11.0
         config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'

      end
    end
  end
end
```

### Error

```
ArgumentError - [Xcodeproj] Unable to find compatibility version string for object version `70`.
/Users/apple/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/xcodeproj-1.27.0/lib/xcodeproj/project.rb:85:in `initialize'
/Users/apple/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/cocoapods-1.16.2/lib/cocoapods/project.rb:48:in `initialize'
/Users/apple/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/cocoapods-1.16.2/lib/cocoapods/installer/xcode/pods_project_generator/project_generator.rb:82:in `new'
/Users/apple/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/cocoapods-1.16.2/lib/cocoapods/installer/xcode/pods_project_generator/project_generator.rb:82:in `create_project'
/Users/apple/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/cocoapods-1.16.2/lib/cocoapods/installer/xcode/pods_project_generator/project_generator.rb:73:in `generate!'
/Users/apple/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/cocoapods-1.16.2/lib/cocoapods/installer/xcode/single_pods_project_generator.rb:16:in `generate!'
/Users/apple/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/cocoapods-1.16.2/lib/cocoapods/installer.rb:320:in `block in create_and_save_projects'
/Users/apple/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/cocoapods-1.16.2/lib/cocoapods/user_interface.rb:64:in `section'
/Users/apple/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/cocoapods-1.16.2/lib/cocoapods/installer.rb:315:in `create_and_save_projects'
/Users/apple/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/cocoapods-1.16.2/lib/cocoapods/installer.rb:307:in `generate_pods_project'
/Users/apple/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/cocoapods-1.16.2/lib/cocoapods/installer.rb:183:in `integrate'
/Users/apple/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/cocoapods-1.16.2/lib/cocoapods/installer.rb:170:in `install!'
/Users/apple/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/cocoapods-1.16.2/lib/cocoapods/command/install.rb:52:in `run'
/Users/apple/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/claide-1.1.0/lib/claide/command.rb:334:in `run'
/Users/apple/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/cocoapods-1.16.2/lib/cocoapods/command.rb:52:in `run'
/Users/apple/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/cocoapods-1.16.2/bin/pod:55:in `<top (required)>'
/Users/apple/.rbenv/versions/3.2.2/lib/ruby/site_ruby/3.2.0/rubygems.rb:319:in `load'
/Users/apple/.rbenv/versions/3.2.2/lib/ruby/site_ruby/3.2.0/rubygems.rb:319:in `activate_and_load_bin_path'
/Users/apple/.rbenv/versions/3.2.2/bin/pod:25: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+Unable+to+find+compatibility+version+string+for+object+version+%6070%60.&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...
 - Unable to find compatibility version string for object version `70`
   https://github.com/CocoaPods/CocoaPods/issues/12840 [open] [14 comments]
   4 weeks ago

 - CocoaPods don't install in my project
   https://github.com/CocoaPods/CocoaPods/issues/12764 [open] [4 comments]
   24 Jul 2025

 - ArgumentError - [Xcodeproj] Unable to find compatibility version string for object version `70`.
   https://github.com/CocoaPods/CocoaPods/issues/12671 [closed] [48 comments]
   a week ago

and 6 more at:
https://github.com/cocoapods/cocoapods/search?q=%5BXcodeproj%5D%20Unable%20to%20find%20compatibility%20version%20string%20for%20object%20version%20%6070%60.&type=Issues&utf8=✓
apple@king-Mac-mini XingDongDemo % 

大概意思是:你的 CocoaPods/Xcodeproj 版本太旧,无法识别 Xcode 16.4 生成的 project 文件格式(objectVersion = 70)。
(Xcode 16.x 引入了新的 .pbxproj 结构版本号 70,但旧的 xcodeproj 库只支持到 60~73)

解决方法:这是我唯一成功的解决方法,


image.png
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容