【问题标题】:Flutter - Specs satisfying the `GoogleMLKit/TextRecognition` dependency were found, but they required a higher minimum deployment targetFlutter - 找到了满足“GoogleMLKit/TextRecognition”依赖的规范,但它们需要更高的最小部署目标
【发布时间】:2021-03-01 05:56:09
【问题描述】:

我有一个颤振应用

我将 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

【问题讨论】:

    标签: ios flutter google-mlkit


    【解决方案1】:

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

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

    【讨论】:

    • 你能分享你的 Podfile 吗? FirebaseML 现在已弃用。它现在被GoogleMLKit 取代。请在此处查看迁移指南:developers.google.com/ml-kit/migration?hl=en。 iOS 的具体说明在这里:developers.google.com/ml-kit/migration/ios?hl=en。另请查看快速入门示例的 Podfile:github.com/googlesamples/mlkit/blob/master/ios/quickstarts/…
    • @Dong Chen 请看问题部分的 Podfile,谢谢。注意:在 Podfile 中根本没有提到 FirebaseFirebaseMLVision
    • 你的 Podfile 除了pod 'GoogleMLKit/TextRecognition' 之外还包含很多其他的东西。例如,它有 flutter_ios_podfile_setupflutter_install_all_ios_pods 没有直接在这个 Podfile 中定义,所以我不知道它们做了什么。由于新的GoogleMLKit 不支持颤振,那些与颤振相关的步骤是否可以引入FirebaseMLVision(旧的FirebaseML 的一部分确实支持颤振,但我们不再支持)?而且您不应该将旧版 FirebaseML 与新版 GoogleMLKit 混用。
    • 如果我删除所有其他行并只保留:平台:ios,'10.0'use_frameworks!项目 'VisionExample.xcodeproj' 目标 'VisionExample' 结束目标 'VisionExampleObjc' 结束 pod 'GoogleMLKit/TextRecognition'。然后可以毫无问题地安装 cocoapod。
    • '新的 GoogleMLKit 不支持颤振',是真的吗?我的应用程序抖动,我该怎么办?
    猜你喜欢
    • 2016-01-30
    • 2021-04-29
    • 1970-01-01
    • 2021-10-11
    • 2021-11-06
    • 1970-01-01
    • 1970-01-01
    • 2016-07-27
    • 1970-01-01
    相关资源
    最近更新 更多