首页 > 解决方案 > Flutter - 找到满足“GoogleMLKit/TextRecognition”依赖的规范,但它们需要更高的最小部署目标

问题描述

我有一个颤振应用

我添加pod 'GoogleMLKit/TextRecognition'到我的 pod 文件中,并且做了pod install

我收到错误 Specs satisfying the GoogleMLKit/TextRecognition dependency were found, but they required a higher minimum deployment target.

我想知道:

  1. 是什么minimum deployment target
  2. 我该如何设置?

编辑:

根据董晨的评论,这是我的 Podfile:

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

# 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!

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

pod 'GoogleMLKit/TextRecognition'
post_install do |installer|
  installer.pods_project.build_configurations.each do |config|
    # Can be removed when moving to cocoapods 1.10
    config.build_settings['CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER'] = 'NO'
  end
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)

    target.build_configurations.each do |config|
      # Inherit the deployment target defined in this Podfile instead, e.g. platform :ios, '11.0' at the top of this file
      config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
    end
  end
end

标签: iosfluttergoogle-mlkit

解决方案


platform :ios, '10.0'我可以通过在 pos 文件的顶部进行设置来解决这个错误。

但是当我这样做时,pod install我得到[!] FirebaseMLVision has been deprecated


推荐阅读