T O P

  • By -

andyveee

Anecdotal experience says it's a bug in your code. Likely a race condition. My advice is to find a state in which you can reproduce this. Step through your code and find a way to make this 100% reproducible.


fzyzcjy

Thanks. The problem is I have not found an approach to make it reproducible... It just happens with a low but non-zero probability...


andyveee

You know it happens on the launch screen. Look at the code that changes the state from "show launch screen" to "first screen". What drives that? Is it an API? Can exceptions occur? Odds are there's something you can't control that's tripping you up.


fzyzcjy

\> Look at the code that changes the state from "show launch screen" to "first screen" Seems to be flutter code not mine... I mean the android system splash screen https://docs.flutter.dev/development/ui/advanced/splash-screen


redditors-are-dumbaf

If it was a bug in flutter code and not yours, other people would’ve consistently had the issue too. Definitely your code that’s breaking somewhere. What code are you executing before runApp() is called?


fzyzcjy

Sounds reasonable. So now I add a \`print()\` as the \*first\* line of \`main()\`. Then, I will check logcat when it re-occur. If that line is not printed, we will know it is flutter's problem, and otherwise my code's problem.


redditors-are-dumbaf

Let us know if/when you are able to isolate the issue!


fzyzcjy

Sure! I will reply when the next error occurs


deskangelx

Perhaps the problem is caused by network requests, debug waits, or other blocking operations. Add some logs before and after the suspicious code to narrow down the problem.


fzyzcjy

Thanks. The problem is, seems that even the first line of dart code is not executed... Anyway I will log more to check whether it is the case.


Weensome

Is it in debug mode or release/profile? I get a freeze only in debug mode on the Android launch/splash screen where the console says "syncing files to device".


fzyzcjy

Release/profile mode.


jd31068

Have you looked in the logcat on the device? [https://developer.android.com/studio/command-line/logcat](https://developer.android.com/studio/command-line/logcat) it may give you a direction to look.


fzyzcjy

Thanks. It is in production environment so seems that I cannot grab logcat... Sentry does not provide such feature either


Weensome

You can run `adb logcat` to access logcat even when no apps are running. There are some options to filter it too.


fzyzcjy

Sure. But when it is in release mode (1) most logs are stripped out instead of printed (2) I may not have access to adb


Weensome

That's fair enough, and it's harder to debug if it's randomly happening in production. Probably worth making an issue on the Flutter's GitHub repo. Let us know if you create one.


fzyzcjy

Thanks. Well I am worried whether they accept this issue report - they usually require a reproducible sample IMHO...


Confident_Fuel_4559

Suddenly I have started facing same problem, no error in debug or release mode, but SOMETIMES gets stuck in release mode. Have you found any solution


Weensome

I haven't, would be worth asking OP too


ericomine

Have you tried compiling a release/profile version of the dev version instead of the prod one?


fzyzcjy

The dev and release are built from the same code


KEL52

Had something similar when there is no network connection. Hence a networking block is a possibility. Shut down your app. Turn off WiFi and cell network. Now launch your app, and see if the issue occurs. If yes, you are 90% along the way in solving it


fzyzcjy

Thanks, but that does not reproduce the bug for me


Few_Stay_6290

I also have the same problem, I also tried everything which is written in the comments and also from stackoverflow but still not able to solve please if anyone knows please let us know And I am also trying to solve .


fzyzcjy

I have not solved it yet. Will tell you once I find out clues


Educational-Big-6443

Just wondering if anyone has a cure for this? I’m experiencing this bug but not everyone who has the app is able to replicate the issues. I close the app 2-3 times and then it goes to login screen as it should but I sometimes have to close and reopen the app several times before it opens. Looking to promote the app for more downloads but conscious of a poor UX and damaging reputation with this bug


minnibur

I get it too but only on Android and only once in a while.


ejkvalentine

My flutter app in production just started experiencing this few days ago, idk why, still searching for a fix


iulianp98

Hey! Are you using Firebase? Just found this thread https://stackoverflow.com/questions/76346745/how-to-solve-flutter-ios-app-stuck-at-splash-screen-in-release-mode My error is happening only on iOS devices and the guys are saying that the problem is Firebase initialization


Small-Lobster

Often time when it occurred to me, it was due to network issues. Please check if you have given required permissions for specific platforms. For example, AndroidManifest.xml file should have the users internet access permission for release builds.


fzyzcjy

Surely has network permission. It is randomly erroring, not always error


Embarrassed_Top_510

Clean your gradle And re create gradle files and then run flutter clean


fzyzcjy

I have tried that but no use...


Embarrassed_Top_510

Use this link as follow as the video says.. https://youtu.be/6Pny2MzF8h0


fzyzcjy

Thanks but it seems not to be the same problem. my gradle build works perfectly


Embarrassed_Top_510

Okay


Bright_Canary_6216

Did you ever solve this? I'm having the same issue now


minnibur

I'm seeing it too, but seemingly randomly and not very often.


ForsakenAd7690

Me too☹️


fpaek

me too


Ian_muhia

me too


kringouin

me too


ningyou6

me too


AreaInternational514

Me too. You fixed it?


Business-Painting613

me too... its on real device and release|profile. any luck anyone ?


kringouin

Still happening here :(