将共享扩展添加到我的 Flutter iOS 项目后尝试运行 pod install 时,我收到此错误:
CopyArgumentError - [Xcodeproj] Unable to find compatibility version string for object version `70`.
环境:
我的 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
重现步骤:
尝试过的事情:
该项目在没有共享扩展的情况下运行良好,我已将其删除并添加了多个图块。有什么想法如何解决这个问题吗?
我在这里找到了答案:https://github.com/CocoaPods/CocoaPods/issues/12671#issuecomment-2445304215
添加扩展时,它会将您的 objectVersion 更改为 70,因此我需要将其更改回来