How to specify target platform ios version number in Codemagic

2,810

Solution 1

Finally, I solved the issue by manually creating Podfile as in the following.

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

def parse_KV_file(file,seperator='=')
  file_abs_path = File.expand_path(file)
  if !File.exists? file_abs_path
    return [];
  end
  pods_ary = []
  skip_line_start_symbols = ["#", "/"]
  File.foreach(file_abs_path) { |line|
      next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
      plugin = line.split(pattern=seperator)
      if plugin.length == 2
        podname = plugin[0].strip()
        path = plugin[1].strip()
        podpath = File.expand_path("#{path}", file_abs_path)
        pods_ary.push({:name => podname,:path=>podpath});
      else
        puts "Invalid plugin specification: #{line}"
      end
  }
  return pods_ary
end

target 'Runner' do
  # Flutter Pods
  use_frameworks!
  use_modular_headers!
  generated_xcode_build_settings = parse_KV_file("./Flutter/Generated.xcconfig")
  if generated_xcode_build_settings.empty?
    puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter build or flutter run is executed once first."
  end
  generated_xcode_build_settings.map{ |p|
    if p[:name]=='FLUTTER_FRAMEWORK_DIR'
      pod 'Flutter', :path => p[:path]
    end
  }

  # Plugin Pods
  plugin_pods = parse_KV_file("../.flutter-plugins")
  plugin_pods.map{ |p|
    pod p[:name], :path => File.expand_path("ios",p[:path])
  }
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['ENABLE_BITCODE'] = 'NO'
    end
  end
end

Solution 2

you can uncomment the target in podfile. or you can add

platform :ios, '11.0'

at the top of you pod file. you can specify the version you need inside the quote

Share:
2,810
Mutlu Simsek
Author by

Mutlu Simsek

Manager with a demonstrated history of working in the automotive and software engineering industries. Skilled in multi-physics system simulations (GT-SUITE), Python, Machine Learning, Deep Learning/Tensorflow/Keras/PyTorch/NLP, Flutter/Dart, NoSQL/Firebase/Elasticsearch, Javascript/Node.js/Firebase cloud functions, Matlab/Simulink/Stateflow and cloud computing (AWS, GCP)

Updated on November 21, 2022

Comments

  • Mutlu Simsek
    Mutlu Simsek over 1 year

    I am trying to build ios version of my app on Codemagic without a Mac. The build fails with the following messages.

     [!] Automatically assigning platform `iOS` with version `8.0` on target `Runner` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
    
    [!] CocoaPods could not find compatible versions for pod "flutter_facebook_login":
      In Podfile:
        flutter_facebook_login (from `.symlinks/plugins/flutter_facebook_login/ios`)
    
    Specs satisfying the `flutter_facebook_login (from `.symlinks/plugins/flutter_facebook_login/ios`)` dependency were found, but they required a higher minimum deployment target.
    

    It seems that ios version requirement of flutter_facebook_login package is higher than ios 8. I think it will be solved if I can specify a higher ios version. How can I solve this issue?

  • Mutlu Simsek
    Mutlu Simsek about 4 years
    I already tried it. Now I have another error: fatal error: module 'FBSDKCoreKit' not found
  • vishnu anilkumar
    vishnu anilkumar about 4 years
    try pod install, after deleting the Podfile.lock and pods folder in the directory
  • Mutlu Simsek
    Mutlu Simsek about 4 years
    I dont have mac. Is it possible on windows?
  • vishnu anilkumar
    vishnu anilkumar about 4 years
    I think you need a mac to build your ios application. Because you nedd to insttal pods file and also need xcode to take the buld
  • Mutlu Simsek
    Mutlu Simsek about 4 years
    Codemagic and some others claim that it is possible without a mac. It is frustrating.