【问题标题】:Flutter: Parse Issue (Xcode): Module 'image_picker_ios' not foundFlutter:解析问题(Xcode):找不到模块“image_picker_ios”
【发布时间】:2022-08-21 21:36:01
【问题描述】:

enter image description here使用 image_picker 和 image_cropper 时发生错误,它告诉我“未找到模块 \'image_picker_ios\'”

  • 你好@hassan,你能分享更多关于这个问题的信息或日志吗?您是使用包还是将其用作 pubspec.yaml 中的声明
  • @AshishVE 你好,是的,我正在使用 image_picker 包,首先它工作正常,当我添加图像裁剪器包时出现错误。
  • xcode的版本是多少?因此它是最新的?
  • 我猜这可能会有所帮助:stackoverflow.com/questions/64659850/…

标签: swift xcode flutter


【解决方案1】:
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
platform :ios, '9.0'
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
  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)
  end
end

我刚刚在 PodFile 上添加了这段代码并解决了问题。

【讨论】:

    猜你喜欢
    • 2021-12-31
    • 1970-01-01
    • 2013-09-07
    • 2020-09-09
    • 2021-08-09
    • 2022-07-30
    • 2022-01-25
    • 2017-10-23
    • 2021-10-16
    相关资源
    最近更新 更多