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

[Android] Map flickers when app is resumed, and sometimes get transparent. #327

Open
T-moz opened this issue Nov 10, 2023 · 8 comments · May be fixed by #364
Open

[Android] Map flickers when app is resumed, and sometimes get transparent. #327

T-moz opened this issue Nov 10, 2023 · 8 comments · May be fixed by #364
Labels
android bug Something isn't working upstream depends on changes upstream (flutter/maplibre)

Comments

@T-moz
Copy link

T-moz commented Nov 10, 2023

Flickers:

Screen_Recording_20231110-200222.mp4

Transparent:

Screen_Recording_20231110-200512_1.mp4

Steps to reproduce:

  • I reproduced the bug with the example app of flutter_maplibre_gl.
  • I used on Samsung galaxy S9 on Android 10.

flutter doctor:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.13.8, on macOS 14.0 23A344 darwin-arm64, locale en-FR)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.0)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.3)
[✓] VS Code (version 1.84.1)
[✓] Connected device (3 available)
[✓] Network resources

• No issues found!

logs:

I/ViewRootImpl@374d9ac[MainActivity](28559): Relayout returned: old=(0,0,1440,2960) new=(0,0,1440,2960) req=(1440,2960)0 dur=7 res=0x1 s={true 530388320256} ch=false
I/ViewRootImpl@374d9ac[MainActivity](28559): ViewPostIme pointer 0
I/ViewRootImpl@374d9ac[MainActivity](28559): ViewPostIme pointer 1
I/ViewRootImpl@374d9ac[MainActivity](28559): MSG_WINDOW_FOCUS_CHANGED 0 1
D/InputMethodManager(28559): prepareNavigationBarInfo() DecorView@3c6e580[MainActivity]
D/InputMethodManager(28559): getNavigationBarColor() -855310
I/ViewRootImpl@374d9ac[MainActivity](28559): stopped(false) old=false
I/ViewRootImpl@374d9ac[MainActivity](28559): Relayout returned: old=(0,0,1440,2960) new=(0,0,1440,2960) req=(1440,2960)0 dur=6 res=0x1 s={true 530388320256} ch=false
I/ViewRootImpl@374d9ac[MainActivity](28559): MSG_WINDOW_FOCUS_CHANGED 1 1
D/InputMethodManager(28559): prepareNavigationBarInfo() DecorView@3c6e580[MainActivity]
D/InputMethodManager(28559): getNavigationBarColor() -855310
I/PlatformViewsController(28559): Hosting view in view hierarchy for platform view: 0
I/mali_winsys(28559): new_window_surface() [1x1] return: 0x3000
W/Gralloc3(28559): allocator 3.x is not supported
V/Mbgl-ConnectivityReceiver(28559): connected - true
I/Mbgl-EGLConfigChooser(28559): In emulator: false
I/mali_winsys(28559): new_window_surface() [1440x2640] return: 0x3000
I/Mbgl    (28559): {Thread-8}[General]: GPU Identifier: Mali-G72
W/Mbgl    (28559): {Thread-8}[ParseStyle]: Layer '6hkMgsshi2_0' has an invalid value for text-font and will not render text. Output values must be contained as literals within the expression.
W/Mbgl    (28559): {Thread-8}[ParseStyle]: Layer '6hkMgsshi2_0' has an invalid value for text-font and will not render text. Output values must be contained as literals within the expression.
I/SurfaceView(28559): onWindowVisibilityChanged(8) false io.flutter.embedding.android.FlutterSurfaceView{6136de3 V.E...... ........ 0,0-1440,2960} of ViewRootImpl@374d9ac[MainActivity]
I/SurfaceView(28559): surfaceDestroyed callback.size 1 #2 io.flutter.embedding.android.FlutterSurfaceView{6136de3 V.E...... ........ 0,0-1440,2960}
I/mali_egl(28559): eglDestroySurface() in
I/mali_winsys(28559): delete_surface() [1440x2960] return
I/mali_egl(28559): eglDestroySurface() out
W/libEGL  (28559): EGLNativeWindowType 0x7a8f0d0010 disconnect failed
I/SurfaceView(28559): remove() io.flutter.embedding.android.FlutterSurfaceView{6136de3 V.E...... ........ 0,0-1440,2960} Surface(name=SurfaceView - com.mapbox.mapboxglexample/com.mapbox.example.MainActivity@6136de3@0)/@0xfaf2459
I/mali_egl(28559): eglDestroySurface() in
I/mali_winsys(28559): delete_surface() [1440x2960] return
I/mali_egl(28559): eglDestroySurface() out
W/libEGL  (28559): EGLNativeWindowType 0x7b7da83710 disconnect failed
I/ViewRootImpl@374d9ac[MainActivity](28559): Relayout returned: old=(0,0,1440,2960) new=(0,0,1440,2960) req=(1440,2960)8 dur=14 res=0x5 s={false 0} ch=true
I/ViewRootImpl@374d9ac[MainActivity](28559): MSG_WINDOW_FOCUS_CHANGED 0 1
D/InputMethodManager(28559): prepareNavigationBarInfo() DecorView@3c6e580[MainActivity]
D/InputMethodManager(28559): getNavigationBarColor() -855310
I/ViewRootImpl@374d9ac[MainActivity](28559): stopped(true) old=false
I/SurfaceView(28559): windowStopped(true) false io.flutter.embedding.android.FlutterSurfaceView{6136de3 V.E...... ........ 0,0-1440,2960} of ViewRootImpl@374d9ac[MainActivity]
D/InputTransport(28559): Input channel destroyed: 'ClientS', fd=97
I/SurfaceView(28559): onWindowVisibilityChanged(4) false io.flutter.embedding.android.FlutterSurfaceView{6136de3 G.E...... ......I. 0,0-1440,2960} of ViewRootImpl@374d9ac[MainActivity]
I/ViewRootImpl@374d9ac[MainActivity](28559): Relayout returned: old=(0,0,1440,2960) new=(0,0,1440,2960) req=(1440,2960)4 dur=4 res=0x1 s={false 0} ch=false
I/ViewRootImpl@374d9ac[MainActivity](28559): stopped(false) old=true
I/SurfaceView(28559): windowStopped(false) false io.flutter.embedding.android.FlutterSurfaceView{6136de3 G.E...... ......I. 0,0-1440,2960} of ViewRootImpl@374d9ac[MainActivity]
I/ViewRootImpl@374d9ac[MainActivity](28559): stopped(false) old=false
I/SurfaceView(28559): onWindowVisibilityChanged(0) true io.flutter.embedding.android.FlutterSurfaceView{6136de3 V.E...... ......ID 0,0-1440,2960} of ViewRootImpl@374d9ac[MainActivity]
I/ViewRootImpl@374d9ac[MainActivity](28559): Relayout returned: old=(0,0,1440,2960) new=(0,0,1440,2960) req=(1440,2960)0 dur=5 res=0x7 s={true 530388627456} ch=true
I/mali_winsys(28559): new_window_surface() [1440x2960] return: 0x3000
I/SurfaceView(28559): surfaceCreated 1 #5 io.flutter.embedding.android.FlutterSurfaceView{6136de3 V.E...... ......ID 0,0-1440,2960}
I/mali_winsys(28559): new_window_surface() [1440x2960] return: 0x3000
I/SurfaceView(28559): surfaceChanged (1440,2960) 1 #5 io.flutter.embedding.android.FlutterSurfaceView{6136de3 V.E...... ......ID 0,0-1440,2960}
I/OpenGLRenderer(28559): doUpdatePositionAsync is called and callVoidMethod
V/Mbgl-ConnectivityReceiver(28559): connected - true
I/ViewRootImpl@374d9ac[MainActivity](28559): MSG_WINDOW_FOCUS_CHANGED 1 1
D/InputMethodManager(28559): prepareNavigationBarInfo() DecorView@3c6e580[MainActivity]
D/InputMethodManager(28559): getNavigationBarColor() -855310
D/InputMethodManager(28559): prepareNavigationBarInfo() DecorView@3c6e580[MainActivity]
D/InputMethodManager(28559): getNavigationBarColor() -855310
V/InputMethodManager(28559): Starting input: tba=com.mapbox.mapboxglexample ic=null mNaviBarColor -855310 mIsGetNaviBarColorSuccess true , NavVisible : true , NavTrans : false
D/InputMethodManager(28559): startInputInner - Id : 0
I/InputMethodManager(28559): startInputInner - mService.startInputOrWindowGainedFocus

Related informations:

✅ This bug is not present in Maplibre Native.
🐞 This bug is present in mapbox-map-flutter
✅ This bug is not present in google_map_flutter

The root cause might be in the platform-view implementation.

See Google Map

Screen_Recording_20231110-202506.mp4
@m0nac0
Copy link
Collaborator

m0nac0 commented Dec 10, 2023

Everyone who has this issue: on what device and what Android version are you seeing this?

There is an active issue in the flutter repo (flutter/flutter#139039), but that seems to only affect Samsung devices.

@m0nac0 m0nac0 added the android label Dec 10, 2023
@m0nac0
Copy link
Collaborator

m0nac0 commented Dec 10, 2023

Also to everyone who has (upvoted) this issue: It would be great if you can share with Flutter version you see this bug and if this is with Impeller enabled?

@T-moz
Copy link
Author

T-moz commented Dec 12, 2023

Hi @m0nac0, thanks for the hint on the samsung bug 🙏

I saw the bug with two samsung devices. On Flutter 3.13.8, with impeller disabled.
I will test this on an other device brand, and with the recently release version of Flutter.

Note that google_map_flutter also uses platform view and the bug is not present.

@m0nac0
Copy link
Collaborator

m0nac0 commented Dec 12, 2023

I saw the bug with two samsung devices.

Are those two devices on Android 14?

@T-moz
Copy link
Author

T-moz commented Dec 13, 2023

I saw the bug with two samsung devices.

Are those two devices on Android 14?

No there are on Android 10.
By the way, I tried enabling and disabling hybrid composition, that changes nothing.

@m0nac0
Copy link
Collaborator

m0nac0 commented Dec 15, 2023

I saw the bug with two samsung devices

Were those Samsung S22, S23, S22 Ultra, S23 Ultra? (Those are the ones that I've seen mentioned as affected by the upstream Flutter issue)

@m0nac0 m0nac0 added bug Something isn't working question Further information is requested upstream depends on changes upstream (flutter/maplibre) and removed help wanted Extra attention is needed question Further information is requested labels Dec 15, 2023
@T-moz
Copy link
Author

T-moz commented Dec 18, 2023

I reproduced the issues with a Huawei phone under android 8.

The devices brand, and android version were we tested and find the issues:

Brand Device Android version
Samsung Galaxy S9 10
Samsung Galaxy Note 8 10
Huawei P9 light 8

@dennisbordet
Copy link

dennisbordet commented Dec 26, 2023

I complete the reproduction table. It seems to be related to the android version

Brand Device Android version Bug status
Oneplus 7T 12 Not reproduced
Samsung Galaxy s7 8 (samsung experience 9) White screen at first resume from background
  Emulator API 34 Not reproduced
  Emulator API 28 White screen at first resume from background
  Emulator API 29 Flicker only
  Emulator API 30 (android 11) Not reproduced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android bug Something isn't working upstream depends on changes upstream (flutter/maplibre)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants