构建flutter到IOS时找不到BoringSSL-GRPC.modulemap

问题描述 投票:0回答:2

我现在正在将这个应用程序与 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 依赖项版本的问题。这是我的 pubspec.有什么问题吗?

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
ios flutter firebase push-notification cocoapods
2个回答
24
投票

使用

use_frameworks! :linkage => :static
代替
use_modular_headers!

更多详细信息请访问 https://github.com/firebase/firebase-ios-sdk/issues/3816


-2
投票

尝试将其添加到 Podfile 的末尾:

post_install do |installer|
    installer.pods_project.targets.each do |target|
        flutter_additional_ios_build_settings(target)
        target.build_configurations.each do |config|
            config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64 i386"
        end
    end
end
© www.soinside.com 2019 - 2024. All rights reserved.