'Flutter release APK build - Intermittent white screen

My app works perfectly on the Android emulator. When I create a release APK I get this error:

Intermittently, the Scaffold content does not load. The Nav bar and drawer are visible, but not the central content.

This does not happen every time I open the app, only about 1/3 times, on average. There is no obvious pattern to this working or failing.

app not showing scaffold contents[![][1][1]

[✓] Flutter (Channel stable, v1.12.13+hotfix.7, on Mac OS X 10.11.6 15G22010, locale en) • Flutter version 1.12.13+hotfix.7 at /Applications/flutter • Framework revision 9f5ff2306b (3 days ago), 2020-01-26 22:38:26 -0800 • Engine revision a67792536c • Dart version 2.7.0

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3) • Android SDK at /Users/dan/Library/Android/sdk • Android NDK location not configured (optional; useful for native profiling support) • Platform android-28, build-tools 28.0.3 • 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 installation is incomplete; a full installation is necessary for iOS development. Download at: https://developer.apple.com/xcode/download/ Or install Xcode via the App Store. Once installed, run: sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer sudo xcodebuild -runFirstLaunch ✗ CocoaPods not installed. CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side. Without CocoaPods, plugins will not work on iOS or macOS. For more info, see https://flutter.dev/platform-plugins To install: sudo gem install cocoapods

[✓] 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) • klte • 5d3f96b0 • android-arm • Android 7.1.2 (API 25)



Solution 1:[1]

I have a similar case, the scaffold is not drawn, it is as if it were empty, for the moment the solution I found was to generate the apk but in debug mode, change flutter build apk --release to flutter build --debug .

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 CARLOS ANDRES REY BERMUDEZ