最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

ios - CocoaPods Error: Unable to find compatibility version string for object version '70' after adding Share Ex

programmeradmin1浏览0评论

I'm getting this error when trying to run pod install after adding a Share Extension to my Flutter iOS project:

CopyArgumentError - [Xcodeproj] Unable to find compatibility version string for object version `70`.

Environment:

  • CocoaPods: 1.16.2
  • Xcode: 16.1
  • macOS: 15.0.1
  • Flutter project

My Podfile:

rubyCopyENV['COCOAPODS_DISABLE_STATS'] = 'true'

def flutter_root
  generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
  unless File.exist?(generated_xcode_build_settings_path)
    raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
  end

  File.foreach(generated_xcode_build_settings_path) do |line|
    matches = line.match(/FLUTTER_ROOT\=(.*)/)
    return matches[1].strip if matches
  end
  raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}"
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

platform :ios, '13.0'

flutter_ios_podfile_setup

target 'Runner' do
  use_frameworks!
  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end

target 'Share Extension' do
  use_frameworks!
  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end

Steps to reproduce:

  • Working Flutter iOS project with pods installed
  • Added Share Extension target in Xcode
  • Added Share Extension target to Podfile
  • Run pod install -> Error occurs

Things tried:

  • Deleting Pods/, Podfile.lock, Runner.xcworkspace
  • Different Podfile configurations
  • pod deintegrate and reinstall
  • Removing and re-adding Share Extension
  • Downgrading CocoaPods

The project works fine without Share Extension, I've removed it and added it multiple tiles. Any ideas how to resolve this?

I'm getting this error when trying to run pod install after adding a Share Extension to my Flutter iOS project:

CopyArgumentError - [Xcodeproj] Unable to find compatibility version string for object version `70`.

Environment:

  • CocoaPods: 1.16.2
  • Xcode: 16.1
  • macOS: 15.0.1
  • Flutter project

My Podfile:

rubyCopyENV['COCOAPODS_DISABLE_STATS'] = 'true'

def flutter_root
  generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
  unless File.exist?(generated_xcode_build_settings_path)
    raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
  end

  File.foreach(generated_xcode_build_settings_path) do |line|
    matches = line.match(/FLUTTER_ROOT\=(.*)/)
    return matches[1].strip if matches
  end
  raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}"
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

platform :ios, '13.0'

flutter_ios_podfile_setup

target 'Runner' do
  use_frameworks!
  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end

target 'Share Extension' do
  use_frameworks!
  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end

Steps to reproduce:

  • Working Flutter iOS project with pods installed
  • Added Share Extension target in Xcode
  • Added Share Extension target to Podfile
  • Run pod install -> Error occurs

Things tried:

  • Deleting Pods/, Podfile.lock, Runner.xcworkspace
  • Different Podfile configurations
  • pod deintegrate and reinstall
  • Removing and re-adding Share Extension
  • Downgrading CocoaPods

The project works fine without Share Extension, I've removed it and added it multiple tiles. Any ideas how to resolve this?

Share Improve this question asked Nov 19, 2024 at 15:11 Edon FreinerEdon Freiner 6267 silver badges20 bronze badges
Add a comment  | 

5 Answers 5

Reset to default 52

change it and fixed for my issue: https://github/CocoaPods/CocoaPods/issues/12671#issuecomment-2467142931

Anytime you add an Xcode 16-only feature to your project, the format will automatically be updated.

For those who ended up on this thread because of a similar issue with the Project Navigator, explanation below:

When you right-click on the Project Navigator in Xcode, you have the options "New Folder" (Xcode 16 only) or "New Group" (any Xcode version). When you create a New Folder, your objectVersion will automatically be bumped to 70.

  • Right-click on any Folders you've created and select "Convert to Group".
  • When you've finished converting all folders to groups, Xcode won't automatically set the objectVersion to 70.
  • Verify that your project settings are still set to Xcode xx (9.3 or 12.0 or whatever you wanted).

I found an answer here: https://github/CocoaPods/CocoaPods/issues/12671#issuecomment-2445304215

When adding an extension it changes your objectVersion to 70, so I needed to change it back

Found the problem. Something had updated the "objectVersion" value in the project.pbxproj to "70" which I think is not recognized by the xcodeproj yet. I set it to "60" and the error went away.

from https://github/CocoaPods/CocoaPods/issues/12671

Change the Xcode version to current version minus 2 by selecting the PROJECT(above TARGETS)

if your current Xcode version is 16 then choose Xcode 14

发布评论

评论列表(0)

  1. 暂无评论