Flutter android release stuck on splash screen

3,307

Solution 1

I solved this problem by

flutter build apk --no-shrink --split-per-abi

Don't know why, but I think code default shrinking was the problem.

Solution 2

Permanent solution

A permanent solution to @Anirban Das answer is to edit your release buildTypes on app/build.gradle with shrinkResources false as the following:

buildTypes {
    release {
        shrinkResources false
        minifyEnabled false
        signingConfig signingConfigs.release
    }
}
Share:
3,307
Anirban Das
Author by

Anirban Das

Love to laugh... love biriyani... and day or night love to do coding...

Updated on December 01, 2022

Comments

  • Anirban Das
    Anirban Das over 1 year

    Flutter android release build is stuck on splash screen.

    I have tried by cleaning project flutter clean. But still it got stuck on splash screen. I have also used WidgetsFlutterBinding.ensureInitialized(); before executing the runApp(). Still it stuck on splash screen. Also haven't found error logs that can be resolved.

    It is not happening with debug version or when I run with flutter run --release. The app is running smoothly in flutter run --release.

    I'm using flutter 1.22.0 & VSCode 1.49.3. Testing & releasing for android.

    I'm stuck with this last 3 days. It would be very helpful if anyone can help me.

  • nilsmagnus
    nilsmagnus over 3 years
    This did not work for me, I had to downgrade to gradle 6.1.1 and buildtool 4.0.2
  • Mahan Vyakti
    Mahan Vyakti almost 3 years
    I was using some Lottie files (from assets) on the splash screen (of flutter, not the native one). Adding only shrinkResources false helped me resolve this issue in my case.
  • WeSay Solutions
    WeSay Solutions almost 3 years
    I am facing a similar issue. This is happening with Flutter 2.2.3. I integrated a native SDK for ads after which the home screen stopped showing and the app is getting stuck on a black screen. Tried all of the above but none of them has helped resolve the issue