Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Putting the app on background and resuming may lead in a white map #1151

Open
VuillaumeGautier opened this issue Aug 10, 2022 · 16 comments
Open
Labels

Comments

@VuillaumeGautier
Copy link

Hello !

On a low perfomance phone, putting the app on background, and resuming it afterward may result in the map widget being completly white.

This happens on a Samsung Galaxy A40, Android 11 and a Oppo A9, both being slow phones. Seemingly no issue on iOS or Samsung Galaxy S20 with Android 12.

@stale
Copy link

stale bot commented Oct 9, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Oct 9, 2022
@stale stale bot removed stale labels Oct 10, 2022
@ranjithbobby89
Copy link

any update on the above issue? any fixes?

@VuillaumeGautier
Copy link
Author

Seems to be still happening. No idea what to do to reproduce the exact bug. It can happen on any device.
It also happens occasionally when poping a route to the screen containing the map.
No workaround, no bug hint and no reproducible path yet on our side.

@ranjithbobby89
Copy link

yeah, we can place the Mapbox on the resume state and open the native camera or any new app then instead of clicking a recent button and opening Mapbox it goes blank white screen.

@ranjithbobby89
Copy link

#1218 , #1277

@ranjithbobby89
Copy link

@VuillaumeGautier any update on the issue still facing the mapbox vanish issue? You're able to reproduce the issue at mentioned above steps.

Thanks!

@steveneal
Copy link

This is affecting our users too... any updates please ????

@srmncnk
Copy link
Contributor

srmncnk commented Mar 6, 2023

AFAIR we put the map in an lifecycle observable and disposed its controller as soon as app got out of focus. And when in focus, we triggered map rebuild to get a new controller. Worked well.

@steveneal
Copy link

steveneal commented Mar 11, 2023

AFAIR we put the map in an lifecycle observable and disposed its controller as soon as app got out of focus. And when in focus, we triggered map rebuild to get a new controller. Worked well.

@srmanc

Can you share more details of your work-around this please?

I've been trying things like this for a couple of days now and am getting nowhere.

@sKY02644
Copy link

sKY02644 commented Jun 15, 2023

@steveneal did you get a solution please #1339 i am facing similar issue kindly assist @srmncnk

@sKY02644
Copy link

@srmncnk can you tell how you fixed it please

@srmncnk
Copy link
Contributor

srmncnk commented Jun 16, 2023

@sKY02644 @steveneal Not sure if you have the same issue, but we went like this.

  1. First problem is that you shouldn't do anywhing with the map once it's out of focus. Bad things happen on Android with it. So we put a Lifecycle observer and as soon as map was out of focus (when switching between apps and also when you pull down a system menu), it should be disposed and recreated, once map is in focus again.

  2. Second problem with Flutter 3.x was a disposal bug - native code was touching the widget source after it was disposed. There was a workaround with the delayed disposal from me, but the real fix was from @felix-ht who dove into the framework and found the correct fix: Fix flutter 3.x crashes #1293

@sKY02644
Copy link

@srmncnk can you assist me to implement that i am unable to do it currently

@srmncnk
Copy link
Contributor

srmncnk commented Jun 16, 2023

You should be fine if you use version from master. @sKY02644

@sKY02644
Copy link

@srmncnk okay will give it a try and let you know before close of work today thank you

@sKY02644
Copy link

@srmncnk thanks soo far soo good everything is working fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants