flutter-maplibre-gl icon indicating copy to clipboard operation
flutter-maplibre-gl copied to clipboard

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

Open T-moz opened this issue 1 year ago • 8 comments

Flickers:

https://github.com/maplibre/flutter-maplibre-gl/assets/28344195/ed195bb3-1602-4182-8284-397791a7bff4

Transparent:

https://github.com/maplibre/flutter-maplibre-gl/assets/28344195/e5cfe473-d04e-41e4-916b-e9e500a73ecc

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

https://github.com/maplibre/flutter-maplibre-gl/assets/28344195/43dcb350-b010-4de3-ac61-bc90b92f7035

T-moz avatar Nov 10 '23 19:11 T-moz

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 (https://github.com/flutter/flutter/issues/139039), but that seems to only affect Samsung devices.

m0nac0 avatar Dec 10 '23 10:12 m0nac0

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?

m0nac0 avatar Dec 10 '23 10:12 m0nac0

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.

T-moz avatar Dec 12 '23 10:12 T-moz

I saw the bug with two samsung devices.

Are those two devices on Android 14?

m0nac0 avatar Dec 12 '23 14:12 m0nac0

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.

T-moz avatar Dec 13 '23 14:12 T-moz

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 avatar Dec 15 '23 16:12 m0nac0

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

T-moz avatar Dec 18 '23 14:12 T-moz

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

dennisbordet avatar Dec 26 '23 10:12 dennisbordet