简体   繁体   English

iOS 设备上的白屏/黑屏,但在模拟器和 Android 上运行良好

[英]White/Blank screen on iOS device, but work just fine on Simulator and Android

I have a Flutter app that is almost just the basic Android Studio template.我有一个 Flutter 应用程序,它几乎只是基本的 Android Studio 模板。 When I run the app on the Android emulator or the iOS simulator it works just fine and displays my widgets, and when I make a release build for Android it also works just fine, but when I make a release build for iOS and run it on a iPhone I am only seeing a white/blank screen with no widgets displayed.当我在 Android 模拟器或 iOS 模拟器上运行应用程序时,它运行良好并显示我的小部件,当我为 Android 制作发布版本时,它也可以正常工作,但是当我为 iOS 制作发布版本并在其上运行时iPhone 我只看到一个白色/空白屏幕,没有显示任何小部件。 I have googled this and tried with flutter clean before my build but I can not figure out why this is happening.我已经用谷歌搜索了这个并在构建之前尝试了 flutter clean 但我无法弄清楚为什么会发生这种情况。 Please any ideas here?请问这里有什么想法吗?

I have now also tried running on the device from the XCode workspace, there I also get a white/blank screen and this in the console log:我现在也尝试从 XCode 工作区在设备上运行,在那里我也得到了一个白色/空白屏幕,并且在控制台日志中:

2019-06-25 11:10:43.248687+0200 Runner[513:22949] Failed to find snapshot: /var/containers/Bundle/Application/B27448A1-A487-44FC-B6F7-CCFBDFCBB0AD/Runner.app/Frameworks/App.framework/flutter_assets/kernel_blob.bin
2019-06-25 11:10:43.533596+0200 Runner[513:22949] You've implemented -[<UIApplicationDelegate> application:performFetchWithCompletionHandler:], but you still need to add "fetch" to the list of your supported UIBackgroundModes in your Info.plist.
2019-06-25 11:10:43.533634+0200 Runner[513:22949] You've implemented -[<UIApplicationDelegate> application:didReceiveRemoteNotification:fetchCompletionHandler:], but you still need to add "remote-notification" to the list of your supported UIBackgroundModes in your Info.plist.
2019-06-25 11:10:43.538915+0200 Runner[513:23047] [VERBOSE-2:engine.cc(115)] Engine run configuration was invalid.
2019-06-25 11:10:43.539130+0200 Runner[513:23047] [VERBOSE-2:FlutterEngine.mm(304)] Could not launch engine with configuration.
2019-06-25 11:10:43.539359+0200 Runner[513:23071] flutter: Observatory listening on http://127.0.0.1:51568/Vcbbvx3tfNI=/

I have ziped my entire project here: https://www.dropbox.com/s/v8olmovqjquxveg/thisisit.zip?dl=0我在这里压缩了我的整个项目: https ://www.dropbox.com/s/v8olmovqjquxveg/thisisit.zip?dl =0

Thank you谢谢
Søren索伦

please go product>scheme>Edit Schema and select Build Configuration "Release"请转到产品>方案>编辑架构并选择构建配置“发布”

在此处输入图片说明

and then进而

在此处输入图片说明

React-native =>反应原生 =>
First Paste Code In AppDelegate首先在 AppDelegate 中粘贴代码

#if DEBUG
// return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
#else
return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"] //[RNGoogleSignin application:application openURL:url options:options];
#endif
}

If you are using provison_profile in xcode for creating build then check provison_profile in appledeveloper account that is valid or not, if not valid then click on this and edit provison_profile & save and donwload & install in your mac.如果您在 xcode 中使用 provison_profile 来创建构建,请检查 appledeveloper 帐户中的 provison_profile 是否有效,如果无效,则单击此选项并编辑 provison_profile 并保存并下载并安装在您的 mac 中。

Now you can create build.现在您可以创建构建。

解决方案是删除 ios 文件夹并通过在项目文件夹上调用“flutter create”来重新创建它。

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

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