【问题标题】:How to specify target platform ios version number in Codemagic如何在 Codemagic 中指定目标平台 ios 版本号
【发布时间】:2020-07-17 09:04:45
【问题描述】:

我正在尝试在没有 Mac 的情况下在 Codemagic 上构建我的应用程序的 ios 版本。构建失败并显示以下消息。

 [!] 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.

flutter_facebook_login包的ios版本要求好像比ios 8要高,我想如果能指定更高的ios版本就可以解决了。 我该如何解决这个问题?

【问题讨论】:

    标签: ios flutter dart codemagic


    【解决方案1】:

    最后,我通过手动创建 Podfile 解决了这个问题,如下所示。

    # 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
    
    

    【讨论】:

      【解决方案2】:

      您可以取消注释 podfile 中的目标。 或者你可以添加

      platform :ios, '11.0'
      

      在你的 pod 文件的顶部。您可以在报价单中指定您需要的版本

      【讨论】:

      • 我已经试过了。现在我有另一个错误:致命错误:找不到模块'FBSDKCoreKit'
      • 尝试pod install,删除目录中的Podfile.lock和pods文件夹后
      • 我没有mac。 Windows 上可以吗?
      • 我认为你需要一个 mac 来构建你的 ios 应用程序。因为您需要安装 pods 文件并且还需要 xcode 来获取 buld
      • Codemagic 和其他一些人声称没有 mac 是可能的。这很令人沮丧。
      猜你喜欢
      • 1970-01-01
      • 2021-01-20
      • 2021-10-17
      • 1970-01-01
      • 2020-09-29
      • 2021-10-30
      • 2015-04-30
      • 2011-03-09
      • 2018-01-23
      相关资源
      最近更新 更多