barcode_scan2 icon indicating copy to clipboard operation
barcode_scan2 copied to clipboard

[Bug] Update the IPHONEOS_DEPLOYMENT_TARGET to 9.0

Open mklepaczko opened this issue 3 years ago • 1 comments

BUG REPORTS WITHOUT PROVIDING THESE INFORMATIONS WILL BE CLOSED DIRECTLY. DON'T REMOVE THE SECTIONS!

Describe the bug /Users/builder/clone/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 15.2.99. (in target 'MTBBarcodeScanner' from project 'Pods')

IOS 8.0 is no longer supported in latests projects

mklepaczko avatar Jan 23 '22 00:01 mklepaczko

set the pods to a specified target or just delete them like this:

post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
    # ----- 下面的代码使所有pods iOS Deployment target设为11.0 ----- #
    target.build_configurations.each do |config|
      #config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
      config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
    end
    # ----- ----- #
  end
end

the total example looks like this:

# Uncomment this line to define a global platform for your project
platform :ios, '11.0'
inhibit_all_warnings!

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
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!
  
  pod 'HandyJSON', '5.0.2'
  pod 'LosslessJSON', git:'https://github.com/guolingege/LosslessJSON.git', branch: '1.6'
  pod 'MJExtension', '3.2.1'

  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
    # ----- 下面的代码使所有pods iOS Deployment target设为11.0 ----- #
    target.build_configurations.each do |config|
      #config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
      config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
    end
    # ----- ----- #
  end
end

guolingege avatar Apr 04 '22 10:04 guolingege