[英]Firebase won't run with iOS simulator. Flutter
as I said in the title I'm not able to run iOS simulator with Firecloud.正如我在标题中所说,我无法使用 Firecloud 运行 iOS 模拟器。 If I only add Firebase_core package to pubspec.yaml all works fine, but when I add cloud_firestore: ^3.1.5 I got this error:
如果我只将 Firebase_core package 添加到 pubspec.yaml 一切正常,但是当我添加 cloud_firestore: ^3.1.5 我得到这个错误:
Ps With Android simulator all works fine. Ps 使用 Android 模拟器一切正常。
Launching lib/main.dart on iPhone 13 in debug mode... Running Xcode build... Xcode build done.在调试模式下在 iPhone 13 上启动 lib/main.dart... 运行 Xcode 构建... Xcode 构建完成。 9.3s Failed to build iOS app Error output from Xcode build: ↳ ** BUILD FAILED **
9.3s 无法构建 iOS 应用程序错误 output 来自 Xcode 构建:↳ ** BUILD FAILED **
Xcode's output: ↳ /Users/luca/Desktop/prova/ios/Pods/gRPC-Core/third_party/upb/upb/port.c:2:10: fatal error: 'upb/port_def.inc' file not found #include "upb/port_def.inc" ^~~~~~~~~~~~~~~~~~ 1 error generated. Xcode 的 output: ↳ /Users/luca/Desktop/prova/ios/Pods/gRPC-Core/third_party/upb/upb/port.c:2:10: 致命错误: 'upinclude' 找不到文件"upb/port_def.inc" ^~~~~~~~~~~~~~~~~~ 1个错误生成。 /Users/luca/Desktop/prova/ios/Pods/gRPC-Core/third_party/upb/upb/msg.c:2:10: fatal error: 'upb/msg.h' file not found #include "upb/msg.h" ^~~~~~~~~~~ 1 error generated.
/Users/luca/Desktop/prova/ios/Pods/gRPC-Core/third_party/upb/upb/msg.c:2:10:致命错误:找不到'upb/msg.h'文件#include“upb/msg .h" ^~~~~~~~~~~ 产生1个错误。 note: Using new build system note: Planning note: Build preparation complete note: Building targets in dependency order /Users/luca/Desktop/prova/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 15.2.99.
注意:使用新的构建系统 注意:规划注意:构建准备完成 注意:按依赖顺序构建目标 /Users/luca/Desktop/prova/ios/Pods/Pods.xcodeproj:警告:iOS 模拟器部署目标“IPHONEOS_DEPLOYMENT_TARGET”已设置到 8.0,但支持的部署目标版本范围是 9.0 到 15.2.99。 (in target 'BoringSSL-GRPC' from project 'Pods') /Users/luca/Desktop/prova/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 15.2.99.
(在项目“Pods”的目标“BoringSSL-GRPC”中)/Users/luca/Desktop/prova/ios/Pods/Pods.xcodeproj:警告:iOS 模拟器部署目标“IPHONEOS_DEPLOYMENT_TARGET”设置为 8.0,但范围支持的部署目标版本是 9.0 到 15.2.99。 (in target 'abseil' from project 'Pods') /Users/luca/Desktop/prova/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 15.2.99.
(在项目“Pods”的目标“abseil”中)/Users/luca/Desktop/prova/ios/Pods/Pods.xcodeproj:警告:iOS 模拟器部署目标“IPHONEOS_DEPLOYMENT_TARGET”设置为 8.0,但支持的部署范围目标版本是 9.0 到 15.2.99。 (in target 'gRPC-Core' from project 'Pods') /Users/luca/Desktop/prova/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 15.2.99.
(在项目“Pods”的目标“gRPC-Core”中)/Users/luca/Desktop/prova/ios/Pods/Pods.xcodeproj:警告:iOS 模拟器部署目标“IPHONEOS_DEPLOYMENT_TARGET”设置为 8.0,但支持的部署目标版本是 9.0 到 15.2.99。 (in target 'gRPC-C++-gRPCCertificates-Cpp' from project 'Pods') /Users/luca/Desktop/prova/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 15.2.99.
(在项目“Pods”的目标“gRPC-C++-gRPCCertificates-Cpp”中)/Users/luca/Desktop/prova/ios/Pods/Pods.xcodeproj:警告:iOS 模拟器部署目标“IPHONEOS_DEPLOYMENT_TARGET”设置为 8.0,但支持的部署目标版本范围是 9.0 到 15.2.99。 (in target 'leveldb-library' from project 'Pods') /Users/luca/Desktop/prova/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 15.2.99.
(在项目“Pods”的目标“leveldb-library”中)/Users/luca/Desktop/prova/ios/Pods/Pods.xcodeproj:警告:iOS 模拟器部署目标“IPHONEOS_DEPLOYMENT_TARGET”设置为 8.0,但范围支持的部署目标版本是 9.0 到 15.2.99。 (in target 'gRPC-C++' from project 'Pods')
(在项目“Pods”的目标“gRPC-C++”中)
Could not build the application for the simulator.无法为模拟器构建应用程序。 Error launching application on iPhone 13.
在 iPhone 13 上启动应用程序时出错。
Can anyone help me?谁能帮我? I am stuck with this error since 2 weeks ago:S thanks to all.
自 2 周前以来,我一直被这个错误困扰:感谢所有人。
Add this line in your pod file在你的 pod 文件中添加这一行
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
target.build_configurations.each do |config|
if config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'].to_f < 9.0
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
end
end
end
end
Solved.解决了。 Thx Nazmul for the support: I did the follow:
感谢 Nazmul 的支持:我做了以下工作:
In pod file just remove comments in target iOS version and changed it to 10. Then I had to delete the cache folder of cocoapods (~/Library/Caches/CocoaPods).在 pod 文件中,只需删除目标 iOS 版本中的注释并将其更改为 10。然后我不得不删除 cocoapods 的缓存文件夹(~/Library/Caches/CocoaPods)。 Now all works “fine”.
现在一切都“正常”。 Over 500s vs the 20s of android to run the project but at least works.
超过 500 秒与 20 秒的 android 来运行该项目,但至少可以工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.