Search code examples
androidflutterdartapkflutter-animation

Flutter: White window after running flutter build APK release


**Flutter Project: When I check and run on the emulator everything works fine,

but when I make an apk and try to run it on my phone, it shows a white screen and it doesn’t start, but I was supposed to show a splash screen and get to the authorization page..

Has anyone encountered such a problem**

Flutter doctor:

[✓] Flutter (Channel unknown, 2.8.1, on macOS 12.3.1 21E258 darwin-arm, locale en-AC) • Flutter version 2.8.1 at /Users/sim/Development/flutter • Upstream repository unknown • Framework revision 77d935af4d (4 months ago), 2021-12-16 08:37:33 -0800 • Engine revision 890a5fca2e • Dart version 2.15.1

[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1) • Android SDK at /Users/sim/Library/Android/sdk • Platform android-32, build-tools 32.1.0-rc1 • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763) • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.3) • Xcode at /Applications/Xcode.app/Contents/Developer • CocoaPods version 1.11.3

[✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.1) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763)


Solution

  • Finally i found a solution

    Changed build type: change buildTypes in android/app/build.gradle

    buildTypes {
        debug {
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
        release {
            signingConfig signingConfigs.release
            minifyEnabled false
            shrinkResources false
            useProguard true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }