Flutter-Release模式下打包iOS程序白屏问题

版本信息:flutter stable, v1.7.8+hotfix.4, on Mac OS X 10.14.6
开发工具:Android Studio

Flutter 项目,在debug模式下,运行到iOS手机没有任何问题,但是在release模式下,运行到手机,启动应用程序后,发现整个程序只有一个白屏,并在控制台有以下输出:

2019-08-01 22:15:40.821919+0800 Runner[11849:2306487] Failed to find snapshot: /var/containers/Bundle/Application/AE0E4ABB-A571-4459-A4B6-BB9D582DF8A3/Runner.app/Frameworks/App.framework/flutter_assets/kernel_blob.bin
2019-08-01 22:15:41.050657+0800 Runner[11849:2306511] [VERBOSE-2:engine.cc(118)] Engine run configuration was invalid.
2019-08-01 22:15:41.050747+0800 Runner[11849:2306511] [VERBOSE-2:FlutterEngine.mm(308)] Could not launch engine with configuration.
2019-08-01 22:15:41.079060+0800 Runner[11849:2306516] flutter: Observatory listening on http://127.0.0.1:54354/Lik__xCHj9w=/

解决方案:
项目目录下,终端执行下面的代码:

1. flutter clean
2. flutter build ios --release
KayedeMacBook-Pro:projectName kaye$ flutter clean
Deleting 'build/'.
Deleting '/Users/kaye/workspace/flutter/projectName/.dart_tool/'.
KayedeMacBook-Pro: projectName kaye$ flutter build ios --release
Building com.bundle.id for device (ios-release)...
Automatically signing iOS for device deployment using specified development team in Xcode project: xxxxx
Running pod install...                                              1.1s
Running Xcode build...                                                  
                                                   
 ├─Building Dart code...                                    38.1s
 ├─Generating dSYM file...                                   0.3s
 ├─Stripping debug symbols...                                0.0s
 ├─Assembling Flutter resources...                           1.1s
 └─Compiling, linking and signing...                         3.8s
Xcode build done.                                           45.9s
Built /Users/kaye/workspace/flutter/taotao/build/ios/iphoneos/Runner.app.
KayedeMacBook-Pro: projectName kaye$ 

你可能感兴趣的:(Flutter-Release模式下打包iOS程序白屏问题)