4
votes

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.

3
try with the latest version of flutter and run flutter run --release -v to see the logs.Abhishek Ghaskata
The app is not stucking on splash screen when running with flutter run --release. It is only stucking on splash screen in release apk...Anirban Das
are you fetching any data from the internet? IF yes, have you added the internet permission to the android manifest file?OMi Shah
Internet permission is there in the manifest file....Anirban Das

3 Answers

6
votes

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.

5
votes

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
    }
}
0
votes

I used flutter_native_splash version 0.1.8 before and got the same issue, when i updated my flutter_native_splash version to 0.3.0 it works fine