构建到 IOS 的颤振时找不到 BoringSSL-GRPC.modulemap

Posted

技术标签:

【中文标题】构建到 IOS 的颤振时找不到 BoringSSL-GRPC.modulemap【英文标题】:BoringSSL-GRPC.modulemap not found when building flutter to IOS 【发布时间】:2021-04-11 03:15:33 【问题描述】:

我现在正在使用这个带有 firebase 的应用程序,当我尝试在 xcode 中构建时,它会抛出这个错误:

找不到模块映射文件'/--mypath--/ios/Pods/Headers/Private/openssl_grpc/BoringSSL-GRPC.modulemap'

上面是我的 podfile

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

# 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
  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end

post_install do |pi|
  pi.pods_project.targets.each do |t|
    t.build_configurations.each do |config|
      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = "10.0"
    end  
  end
end

我已经尝试了use_frameworks! 并退出了use_modular_headers!,但仍然显示错误。我坚持下去,欢迎任何帮助

更新 我读到这可能是firebase依赖版本的问题。这是我的发布规范。有什么问题吗?

dependencies:
  flutter:
    sdk: flutter
  intl: ^0.16.1
  http: ^0.12.2
  provider: ^4.0.5
  hive: ^1.4.4
  hive_flutter: ^0.3.1
  path_provider: ^1.6.22
  carousel_slider: ^2.3.1    
  dio: ^3.0.10
  permission_handler: ^5.0.1+1
  open_file: ^3.0.3
  flutter_local_notifications: ^3.0.1
  cached_network_image: ^2.3.3
  url_launcher: 5.7.10
  image_picker: ^0.6.7+14
  firebase_storage: ^5.1.0
  firebase_core: ^0.5.2+1
  qr_code_scanner: ^0.0.13
  pdf: ^1.12.0
  printing: ^3.7.1
  cloud_firestore: ^0.14.4
  firebase_messaging: ^7.0.3
  flutter_localizations:
    sdk: flutter

【问题讨论】:

【参考方案1】:

使用use_frameworks! :linkage => :static 而不是use_modular_headers!

更多详情https://github.com/firebase/firebase-ios-sdk/issues/3816

【讨论】:

似乎可以工作,但现在在另一个包中抛出错误:qr_code_scanner-Swift.h'file not found。你能帮忙吗?

以上是关于构建到 IOS 的颤振时找不到 BoringSSL-GRPC.modulemap的主要内容,如果未能解决你的问题,请参考以下文章

构建 XCTest 时找不到文件错误

找不到模块映射文件'/Users/"my_flutter_project_path"/ios/Pods/Headers/Private/openssl_grpc/BoringSSL

运行 ionic cordova build ios 时找不到包含的文件

在xcode中编译ios项目时找不到c++头文件

由于 BoringSSL 证书验证失败,iOS 上的安全 websocket 连接失败

使用 CakeBuild 构建 Xamarin.Android 项目时找不到 mscorlib