简体   繁体   English

Flutter iOS 应用程序在启动时显示白屏并在该屏幕上挂断

[英]Flutter iOS app showing white screen on launch and hang up on that screen

I have a flutter application using a firebase auth library.我有一个使用 firebase auth 库的 flutter 应用程序。 When I launch its iOS version, It shows me a blank white screen and hangs up on that screen.当我启动它的 iOS 版本时,它向我显示一个空白的白色屏幕并在该屏幕上挂断。 I followed all the steps to add some firebase related flags into Info.plist like FirebaseScreenRecordingEnabled - NO, FirebaseScreenRecordingDeactiv - YES and one or two more.我按照所有步骤将一些与 firebase 相关的标志添加到 Info.plist 中,例如 FirebaseScreenRecordingEnabled - NO、FirebaseScreenRecordingDeactiv - YES 以及一两个。 I have tried to clean the build folder and flutter cache.我试图清理构建文件夹和颤振缓存。 Just also tried this below answer as well: iOS Flutter with Firebase : white screen and SIGABRT in FlutterAppDelegate on launch刚刚也尝试了以下答案: iOS Flutter with Firebase : white screen and SIGABRT in FlutterAppDelegate on launch

~/Documents/Work/Workspaces/flutter/myapp $ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, v1.10.7-pre.80, on Mac OS X 10.15.2 19C57, locale en-IN)

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 11.2)
[✓] Android Studio (version 3.5)
[!] VS Code (version 1.41.1)
    ✗ Flutter extension not installed; install from
      https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[!] Connected device
    ! No devices available

! Doctor found issues in 2 categories.

FYI, I am using Android Studio for a flutter app.仅供参考,我正在将 Android Studio 用于 Flutter 应用程序。

Here are the logs from xCode logger:以下是来自 xCode 记录器的日志:

2020-01-09 21:29:10.811285+0530 my-app[4621:1081677] Failed to find snapshot: /var/containers/Bundle/Application/57CC0DF5-D142-4748-A3D3-66E62A9F1A53/my-app.app/Frameworks/App.framework/flutter_assets/kernel_blob.bin
2020-01-09 21:29:11.365554+0530 my-app[4621:1081942] flutter: Observatory listening on http://127.0.0.1:57358/yuCVtFtKdlI=/
2020-01-09 21:29:11.426615+0530 my-app[4621:1081677] Configuring the default Firebase app...
2020-01-09 21:29:11.427922+0530 my-app[4621:1081920] 6.14.0 - [Firebase/Core][I-COR000004] App with name __FIRAPP_DEFAULT does not exist.
2020-01-09 21:29:11.429326+0530 my-app[4621:1081920] 6.14.0 - [Firebase/Core][I-COR000008] The project's Bundle ID is inconsistent with either the Bundle ID in 'GoogleService-Info.plist', or the Bundle ID in the options if you are using a customized options. To ensure that everything can be configured correctly, you may need to make the Bundle IDs consistent. To continue with this plist file, you may change your app's bundle identifier to 'dev.bipin.myapp'. Or you can download a new configuration file that matches your bundle identifier from https://console.firebase.google.com/ and replace the current one.
2020-01-09 21:29:11.547978+0530 my-app[4621:1081677] Configured the default Firebase app __FIRAPP_DEFAULT.
2020-01-09 21:29:11.614019+0530 my-app[4621:1081932] [VERBOSE-2:engine.cc(127)] Engine run configuration was invalid.
2020-01-09 21:29:11.614685+0530 my-app[4621:1081932] [VERBOSE-2:shell.cc(443)] Could not launch engine with configuration.
2020-01-09 21:29:11.696741+0530 my-app[4621:1081928] 6.14.0 - [Firebase/Analytics][I-ACS023007] Analytics v.60107000 started
2020-01-09 21:29:11.697266+0530 my-app[4621:1081928] 6.14.0 - [Firebase/Analytics][I-ACS023008] To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled
2020-01-09 21:29:13.657220+0530 my-app[4621:1081923] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /private/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles
2020-01-09 21:29:13.662995+0530 my-app[4621:1081923] [MC] Reading from public effective user settings.
2020-01-09 21:29:34.648535+0530 my-app[4621:1082005] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C1.1:2][0x14de28120] get output frames failed, state 8196
2020-01-09 21:29:34.649072+0530 my-app[4621:1082005] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C1.1:2][0x14de28120] get output frames failed, state 8196
2020-01-09 21:29:34.650329+0530 my-app[4621:1082005] TIC Read Status [1:0x0]: 1:57
2020-01-09 21:29:34.650477+0530 my-app[4621:1082005] TIC Read Status [1:0x0]: 1:57
2020-01-09 21:29:42.223040+0530 my-app[4621:1082027] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C2.1:2][0x14dd3cee0] get output frames failed, state 8196
2020-01-09 21:29:42.224070+0530 my-app[4621:1082027] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C2.1:2][0x14dd3cee0] get output frames failed, state 8196
2020-01-09 21:29:42.225360+0530 my-app[4621:1082027] TIC Read Status [2:0x0]: 1:57
2020-01-09 21:29:42.225503+0530 my-app[4621:1082027] TIC Read Status [2:0x0]: 1:57

But no luck so far.但到目前为止没有运气。 Can any please help me here.任何人都可以在这里帮助我。 Thanks谢谢

Error log clearly saying that错误日志清楚地说

The project's Bundle ID is inconsistent with either the Bundle ID in 'GoogleService-Info.plist', or the Bundle ID in the options if you are using a customized options.项目的 Bundle ID 与“GoogleService-Info.plist”中的 Bundle ID 不一致,或者如果您使用的是自定义选项,则与 options 中的 Bundle ID 不一致。 To ensure that everything can be configured correctly, you may need to make the Bundle IDs consistent.为了确保一切都可以正确配置,您可能需要使 Bundle ID 保持一致。 To continue with this plist file, you may change your app's bundle identifier to 'com.tethys.client'.要继续使用此 plist 文件,您可以将应用程序的包标识符更改为“com.tethys.client”。 Or you can download a new configuration file that matches your bundle identifier from https://console.firebase.google.com/ and replace the current one.或者,您可以从https://console.firebase.google.com/下载与您的包标识符匹配的新配置文件并替换当前配置文件。

Try replacing your GoogleService-Info.plist from iOS project.尝试从 iOS 项目替换您的GoogleService-Info.plist Make sure it has a valid Bundle ID确保它有一个有效的 Bundle ID

Also, Make sure if you are running a below command before creating an archive or before distributing it.另外,请确保在创建存档或分发存档之前您是否正在运行以下命令。

flutter build ios --release

or或者

flutter build ios

flutter build defaults to --release . flutter build默认为--release

flutter clean扑干净

flutter build --release颤振构建 --release

then XCode/Archive然后 XCode/存档

As of 28 April 2021, what worked for me (after days of struggle):截至 2021 年 4 月 28 日,对我有用的方法(经过几天的斗争):

in AppDelegate.swift (flutter-project/ios/Runner): Add these 2 lines:在 AppDelegate.swift (flutter-project/ios/Runner) 中:添加以下两行:

FirebaseApp.configure()
GeneratedPluginRegistrant.register(with: self)

in terminal:在终端:

flutter build ios颤振构建 ios

Then run your project in XCode然后在 XCode 中运行你的项目

哦,我终于发现 iOS 14 及更高版本的设备存在 Flutter 框架问题,请在此处查看更多详细信息: https : //github.com/flutter/flutter/issues/60657#issuecomment-688478590

I have encountered this problem.我遇到过这个问题。

My method is:我的方法是:

Run Packages upgrade in pubspec.yaml file在 pubspec.yaml 文件中运行包升级

Hope to be able to help you.希望能帮到你。

Could be the package_info_plus plugin , the white screen appear when you invoke the PackageInfo packageinfo = await PackageInfo.from Platform();可能是package_info_plus plugin ,调用PackageInfo packageinfo = await PackageInfo.from Platform();时出现白屏method before runApp(App()); runApp(App());之前的方法runApp(App());

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM