作者: | 来源:互联网 | 2023-08-14 12:08
我现在正在将此应用程序与 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
回答
使用use_frameworks! :linkage => :static
代替use_modular_headers!
更多详情请访问https://github.com/firebase/firebase-ios-sdk/issues/3816