未在IOS模拟器上运行或构建的Flutter应用程序



这是我第一次使用StackOverflow来解决实际问题,所以提前感谢。

我开始使用Flutter构建应用程序(最初仅用于android),我绝对喜欢它。

在完成我的应用程序并将其部署到Google Play商店后,我给自己买了一台Macbook,我正试图使用Flutter代码并将其也发布到App Store。

我的程序正在使用Firebase,我很确定错误是负责任的,但不幸的是,我无法找到或修复它。

我已经做了什么?我为IOS做了完整的Firebase设置,这意味着下载google Services文件并将其放在xcode的第一个Runner部分下。

我也设置了firebase告诉我的其余部分。(pod install etc)

该应用程序在Android模拟器上运行完全正常,但在IOS模拟器上无法启动。

我正在使用VSCode。

在代码中没有任何错误。

我也改变了pod(第一行)的最低版本为10.12。否则我不可能装载这些必要的pod。

构建错误代码:

Launching lib/main.dart on iPhone 12 Pro Max in debug mode...
lib/main.dart
Xcode build done.                                           346,1s
Failed to build iOS app
Error output from Xcode build:
↳
* BUILD FAILED *
Xcode's output:
↳
While building module 'firebase_core' imported from /usr/local/Caskroom/flutter/1.22.6/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.16.0/ios/Classes/FLTTransactionStreamHandler.m:6:
In file included from <module-includes>:1:
In file included from /Users/fabianschimpfhauser/Desktop/WhoWouldrather/whowouldrather/ios/Pods/Target Support Files/firebase_core/firebase_core-umbrella.h:13:
In file included from //usr/local/Caskroom/flutter/1.22.6/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-0.7.0/ios/Classes/FLTFirebaseCorePlugin.h:11:
//usr/local/Caskroom/flutter/1.22.6/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-0.7.0/ios/Classes/FLTFirebasePlugin.h:9:9: error: include of non-modular header inside framework module 'firebase_core.FLTFirebasePlugin': '/Users/fabianschimpfhauser/Desktop/WhoWouldrather/whowouldrather/ios/Pods/Headers/Public/FirebaseCore/FirebaseCore.h' [-Werror,-Wnon-modular-include-in-framework-module]
#import <FirebaseCore/FirebaseCore.h>
^
1 error generated.
/usr/local/Caskroom/flutter/1.22.6/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.16.0/ios/Classes/FLTTransactionStreamHandler.m:6:9: fatal error: could not build module 'firebase_core'
#import <firebase_core/FLTFirebasePluginRegistry.h>
~~~^
2 errors generated.
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
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 14.4.99. (in target 'leveldb-library' from project 'Pods')
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 14.4.99. (in target 'shared_preferences' from project 'Pods')
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 14.4.99. (in target 'in_app_purchase' from project 'Pods')
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 14.4.99. (in target 'gRPC-C++-gRPCCertificates-Cpp' from project 'Pods')
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 14.4.99. (in target 'abseil' from project 'Pods')
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 14.4.99. (in target 'BoringSSL-GRPC' from project 'Pods')
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 14.4.99. (in target 'gRPC-Core' from project 'Pods')
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 14.4.99. (in target 'gRPC-C++' from project 'Pods')
warning: Capabilities for Signing & Capabilities may not function correctly because its entitlements use a placeholder team ID. To resolve this, select a development team in the Runner editor. (in target 'Runner' from project 'Runner')
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 14.4.99. (in target 'Flutter' from project 'Pods')
Could not build the application for the simulator.
Error launching application on iPhone 12 Pro Max.
Exited (sigterm)

编辑:添加截图

截图来自Flutter Doctor

Edit2:X-Code Builder ErrorLog

截图

所以,我的假设是:

1 Error:我们可以看到Firebase包的一些错误,但它不应该影响模拟器错误2:这个看起来像是你疼痛的主要原因警告:签名功能&功能可能无法正确运行,因为其授权使用占位符团队ID。要解决这个问题,请在Runner编辑器中选择一个开发团队。(从项目'Runner'创建目标'Runner')

这意味着你必须在代码中打开你的项目并尝试这个解决方案:

进入Xcode首选项->账户,登录到你的苹果账户然后进入你的Xcode项目然后登录;功能和选择您的帐户。

最新更新