I recently updated my Flutter version from 3.7 to 3.16, along with some libraries. Now, I’m encountering an issue when running pod install in the ios folder, and the following error is thrown:
[!] CocoaPods could not find compatible versions for pod "GTMSessionFetcher/Core":
In Podfile:
google_sign_in_ios (from `.symlinks/plugins/google_sign_in_ios/darwin`) was resolved to 0.0.1, which depends on
GoogleSignIn (~> 7.1.0) was resolved to 7.1.0, which depends on
GTMAppAuth (< 5.0, >= 4.1.1) was resolved to 4.1.1, which depends on
GTMSessionFetcher/Core (< 4.0, >= 3.3)
google_sign_in_ios (from `.symlinks/plugins/google_sign_in_ios/darwin`) was resolved to 0.0.1, which depends on
GoogleSignIn (~> 7.1.0) was resolved to 7.1.0, which depends on
GTMSessionFetcher/Core (~> 3.3)
mobile_scanner (from `.symlinks/plugins/mobile_scanner/ios`) was resolved to 3.5.6, which depends on
GoogleMLKit/BarcodeScanning (~> 4.0.0) was resolved to 4.0.0, which depends on
MLKitBarcodeScanning (~> 3.0.0) was resolved to 3.0.0, which depends on
MLKitCommon (~> 9.0) was resolved to 9.0.0, which depends on
GTMSessionFetcher/Core (< 3.0, >= 1.1)
Here is my Podfile:
platform :ios, '14.0'
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}
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}. Try deleting Generated.xcconfig, then run flutter pub get"
end
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
flutter_ios_podfile_setup
target 'Runner' do
use_frameworks!
use_modular_headers!
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
pod 'GTMSessionFetcher', :modular_headers => true
pod 'GoogleUtilities'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
'$(inherited)',
'PERMISSION_CAMERA=1',
'PERMISSION_MICROPHONE=1'
]
end
end
end
target 'ImageNotification' do
use_frameworks!
pod 'GoogleUtilities'
end
Here are the package versions mentioned in the error from pubspec.yaml:
google_sign_in: ^6.2.1
mobile_scanner: ^3.5.7
Steps I’ve tried:
Running flutter pub get before pod install.
Cleaning the CocoaPods cache:
cd ios
rm Podfile.lock
pod cache clean --all
sudo arch -x86_64 pod install --repo-update
pod repo update
pod install
i also tried updating mobile_scanner to 4.0.1
Despite trying all the above, I still get the version conflict.
3