启动iOS应用时,Flutter会显示黑屏

时间:2019-12-27 11:06:33

标签: ios firebase flutter

问题:在正常运行后,我的iOS Flutter应用中出现黑屏 构建(XCode或VSCode或Android Studio),没有错误。立刻 它会安装并启动,屏幕变黑,没有其他迹象。 该应用程序已生成(我可以在屏幕上看到该图标),但是我很快 启动应用程序,它会完全变黑。

设置:(请参见下面的Flutter医生)我正在将Flutter与Firebase结合使用 iOS物理设备中的数据库(也包括各种模拟器类型)。 重要:适用于Android的相同代码正常运行,没有黑色 屏幕上,一切正常!

我很确定Firebase中的所有内容均已正确配置 项目中,我一直在检查每个细节,正如我所说的,何时 启动到Android设备,一切正常。对于iOS GoogleService-Info.plist文件已取代。 XCode中的Signing的配置也已完成,并且那里没有错误。

输出。-

扑打医生-v

[✓] Flutter (Channel stable, v1.12.13+hotfix.5, on Mac OS X 10.15.2
19C57, locale es-ES)
    • Flutter version 1.12.13+hotfix.5 at /Users/desarrollo/development/flutter
    • Framework revision 27321ebbad (2 weeks ago), 2019-12-10 18:15:01 -0800
    • Engine revision 2994f7e1e6
    • Dart version 2.7.0

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at /Users/desarrollo/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native
profiling support)
    • Platform android-29, build-tools 29.0.2
    • Java binary at: /Applications/Android
Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
1.8.0_202-release-1483-b49-5587405)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.3, Build version 11C29
    • CocoaPods version 1.8.4

[✓] Android Studio (version 3.5)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 42.1.1
    • Dart plugin version 191.8593
    • Java version OpenJDK Runtime Environment (build
1.8.0_202-release-1483-b49-5587405)

[✓] VS Code (version 1.41.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.7.1

[✓] Connected device (1 available)
    • iPhone 11 Pro Max • C9503E12-9146-452B-93AE-E31DBEA1097E • ios •
com.apple.CoreSimulator.SimRuntime.iOS-13-3 (simulator)

• No issues found!

pubspec.yaml(假定表格正确):

name: tumeteo_app
description: A new Flutter project.

version: 1.0.0+1

environment:
sdk: ">=2.2.2 <3.0.0"

dependencies:
flutter:
sdk: flutter
firebase_core: ^0.4.3+1
firebase_storage: ^3.1.0
firebase_storage_image: ^0.4.0
cloud_firestore: ^0.13.0+1
firebase_auth: ^0.15.3
curved_navigation_bar: ^0.3.1
carousel_pro: ^1.0.0
firebase_messaging: ^6.0.9
rflutter_alert: ^1.0.3
shared_preferences: ^0.5.6

image_cropper: ^1.1.0
image_picker: ^0.6.2+1

cupertino_icons: ^0.1.2

dev_dependencies:
flutter_test:
sdk: flutter
flutter_launcher_icons: ^0.7.4

flutter_icons:
android: "launcher_icon"
ios: true
image_path: "assets/icon/icon3.png"
adaptative_icon_background: "assets/icon/icon3.png"

flutter:
uses-material-design: true
assets:
- assets/images/

fonts:
- family: PermanentMarker
fonts:
- asset: fonts/PermanentMarker-Regular.ttf
- family: BarlowCondensed
fonts:
- asset: fonts/BarlowCondensed-Regular.ttf
- family: Handlee
fonts:
- asset: fonts/Handlee-Regular.ttf
- family: PathwayGothicOne
fonts:
- asset: fonts/PathwayGothicOne-Regular.ttf
- family: RopaSans
fonts:
- asset: fonts/RopaSans-Regular.ttf

XCode Building的输出:

2019-12-27 11:02:51.658802+0100 Runner[11289:50522]  -
<AppMeasurement>[I-ACS036002] Analytics screen reporting is enabled.
Call +[FIRAnalytics setScreenName:setScreenClass:] to set the screen
name or override the default screen class name. To disable screen
reporting, set the flag FirebaseScreenReportingEnabled to NO (boolean)
in the Info.plist

2019-12-27 11:02:51.981673+0100 Runner[11289:49976]
[VERBOSE-1:callback_cache.cc(132)] Could not parse callback cache,
aborting restore
2019-12-27 11:02:51.984084+0100 Runner[11289:49976] Configuring the
default Firebase app...
2019-12-27 11:02:51.997756+0100 Runner[11289:50520] 6.14.0 -
[Firebase/Core][I-COR000004] App with name __FIRAPP_DEFAULT does not
exist.
2019-12-27 11:02:52.088688+0100 Runner[11289:50521] 6.14.0 -
[Firebase/Analytics][I-ACS023007] Analytics v.60107000 started
2019-12-27 11:02:52.089771+0100 Runner[11289:50521] 6.14.0 -
[Firebase/Analytics][I-ACS023008] To enable debug logging set the
following application argument: -FIRAnalyticsDebugEnabled 
2019-12-27 11:02:52.111059+0100 Runner[11289:49976] Configured the
default Firebase app __FIRAPP_DEFAULT.
2019-12-27 11:02:52.226945+0100 Runner[11289:50556] 6.14.0 -
[Firebase/Messaging][I-FCM001000] FIRMessaging Remote Notifications
proxy enabled, will swizzle remote notification receiver handlers. If
you'd prefer to manually integrate Firebase Messaging, add
"FirebaseAppDelegateProxyEnabled" to your Info.plist, and set it to
NO. Follow the instructions at:
https://firebase.google.com/docs/cloud-messaging/ios/client#method_swizzling_in_firebase_messaging
to ensure proper integration.

VSCode的输出:

Launching lib/main.dart on iPhone 11 Pro Max in debug mode...
Xcode build done. 570,6s
path: satisfied (Path is satisfied), interface: en0
[VERBOSE-1:callback_cache.cc(132)] Could not parse callback cache,
aborting restore
Configuring the default Firebase app...
path: satisfied (Path is satisfied), interface: en0
Configured the default Firebase app __FIRAPP_DEFAULT.
path: satisfied (Path is satisfied), interface: en0
https://firebase.google.com/docs/cloud-messaging/ios/client#method_swizzling_in_firebase_messaging
to ensure proper integration.

1 个答案:

答案 0 :(得分:0)

您添加了脚手架小部件吗?或MaterialApp小部件?尝试创建示例项目,看看效果是否良好。