在iOS设备上为白屏/黑屏,但在Simulator和Android上工作正常

时间:2019-06-25 07:00:35

标签: ios flutter

我有一个Flutter应用程序,它几乎只是基本的Android Studio模板。当我在Android模拟器或iOS模拟器上运行该应用程序时,它可以很好地工作并显示我的小部件;当我为Android制作一个发布版本时,它也可以正常工作,但是当我为iOS制作一个发布版本并在其上运行时iPhone,我只看到白色/空白屏幕,没有显示任何小部件。我已经用谷歌搜索并在构建之前尝试了干净的扑朔迷离,但我不知道为什么会这样。请在这里提出任何想法?

我现在还尝试从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=/

我已经将整个项目压缩在这里:https://www.dropbox.com/s/v8olmovqjquxveg/thisisit.zip?dl=0

谢谢
索伦

3 个答案:

答案 0 :(得分:1)

请进入产品>方案>编辑架构 然后选择构建配置“发布”

enter image description here

然后

enter image description here

答案 1 :(得分:0)

解决方案是删除ios文件夹,然后在项目文件夹上调用“ flutter create”来重新创建。

答案 2 :(得分:0)

React-native =>
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
}

如果您正在xcode中使用provison_profile创建版本,请在appledeveloper帐户中检查有效或无效的provison_profile,如果无效,请单击并编辑provison_profile并保存并下载并安装在Mac中。

现在您可以创建构建了。