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

Screen flickering on iOS since Flutter 2.10.0 #100522

Closed
sy5075391 opened this issue Mar 22, 2022 · 320 comments
Closed

Screen flickering on iOS since Flutter 2.10.0 #100522

sy5075391 opened this issue Mar 22, 2022 · 320 comments
Assignees
Labels
customer: crowd Affects or could affect many people, though not necessarily a specific customer. customer: vroom engine flutter/engine repository. See also e: labels. P2 Priority 2 issue likely blocking a tier-1 customer soon. platform-ios iOS applications specifically. severe: regression It was better in the past than it is now. severe: rendering UI glitches reported at the engine/skia rendering level.

Comments

@sy5075391
Copy link

sy5075391 commented Mar 22, 2022

App screen flickers and freezes, when I restart it, it goes away. This happened after upgrading to flutter 2.10.0, it doesn't always happen.

IMG_3285.MOV
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.10.0, on macOS 11.6.1 20G224 darwin-x64, locale zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 13.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.1)

@danagbemava-nc danagbemava-nc added the in triage Presently being triaged by the triage team. label Mar 22, 2022
@danagbemava-nc
Copy link
Member

Hi @sy5075391, can you upgrade to stable 2.10.3 to see if you still experience this issue?

If you do, please provide the updated flutter doctor -v as well as a complete minimal reproducible code sample that we can use to replicate this.

Thank you

@danagbemava-nc danagbemava-nc added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds. label Mar 22, 2022
@fbcouch
Copy link
Contributor

fbcouch commented Mar 24, 2022

@sy5075391 If you have a reproducible example of this, I would love to take a look at it. We have a handful of reports of a similar flickering in our production app. Unfortunately, I haven't been able to reproduce it myself, and we've only gotten like 4 reports over the course of 2 months. Still, it would be nice to figure out. Here's what it looks like for us (very similar–I added the black box just to obscure personal details from the user):

Flicker.Issue.Censored.mp4

We're still on a 2.10.2-based version, so I'll see about updating to 2.10.3 as well (we have a few extra crash fixes and undo support built in). This PR in 2.10.3 seems like the most likely thing to be relevant: flutter/engine#31656

We've only seen this on iOS (15.2.1 and 15.3.1), but not iPadOS.

Here's the flutter doctor -v from our build agent:

[✓] Flutter (Channel feature/scribble+2.10.2, 2.10.3-0.0.pre.1, on macOS 11.6.3 20G415 darwin-x64, locale en-US)
    • Flutter version 2.10.3-0.0.pre.1 at /Users/build/flutter
    • Upstream repository git@github.com:twinsunllc/flutter.git
    • Framework revision 197aeac420 (3 months ago), 2021-12-14 16:29:34 -0600
    • Engine revision a83ed0e5e3
    • Dart version 2.16.1
    • DevTools version 2.9.2

[!] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at /Users/build/Library/Android/sdk
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.

[✓] Xcode - develop for iOS and macOS (Xcode 13.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2020.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)

[✓] Connected device (1 available)
    • Chrome (web) • chrome • web-javascript • Google Chrome 99.0.4844.83

[✓] HTTP Host Availability
    • All required HTTP hosts are available

Our current engine version (3 commits ahead of 2.10.2): https://github.com/twinsunllc/engine/commits/2.10.2+fixes

@abdulrehmank7
Copy link

abdulrehmank7 commented Mar 31, 2022

Facing same issue on iOS v15.2.1. Getting similar flickering consistently while using app.

[✓] Flutter (Channel stable, 2.10.3, on macOS 12.0.1 21A559 darwin-arm, locale en-IN)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 13.3)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.1)
[✓] IntelliJ IDEA Ultimate Edition (version 2020.3.3)
[✓] Connected device (2 available)
[✓] HTTP Host Availability

Untitled.mp4

@danagbemava-nc
Copy link
Member

Hi @abdulrehmank7, can you provide a complete minimal reproducible code sample?

@abdulrehmank7
Copy link

Hi @abdulrehmank7, can you provide a complete minimal reproducible code sample?

The issue happens randomly. We cannot isolate and replicate the bug.
My hunch is that, this is related to latest Xcode release. In that update we were forced to disable Bitcode as the app was crashing on iOS v13 device. In Xcode official changelog, they said to disable Bitcode to fix the bug. After disabling Bitcode we are seeing the flickering issue regularly.

@danagbemava-nc
Copy link
Member

Without a reproducible sample, it's going to be difficult for us to act on this issue

@abdulrehmank7
Copy link

Without a reproducible sample, it's going to be difficult for us to act on this issue

Not sure how can help you here. But definitely more people will report this issue soon.

@fbcouch
Copy link
Contributor

fbcouch commented Mar 31, 2022

@abdulrehmank7 That's interesting...we also have bitcode disabled...I tried to enable it recently and had issues linking with our custom engine, unfortunately. That would be really strange if that's the issue, but who knows...

I assume your app is not open source, so I can't test it out myself, but are you able to see the issue yourself with any reasonable frequency? (We've only had reports from customers, unfortunately, haven't been able to see the issue ourselves).

I'm hopeful that it will kinda just go away in a future release...if you're able to make it happen at all, it might be worth testing out the beta and master branches...my hunch is that it's a skia issue (or related to flutter and skia interacting). I just patched in a skia commit to our latest custom engine build to fix a relatively infrequent crash down in the GrMtlCommandBuffer when there's an error submitting the buffer or something...I'm hoping that just fixes the flashing issue too 🤷‍♂️

@fbcouch
Copy link
Contributor

fbcouch commented Apr 1, 2022

An update here – unfortunately we're still having reports of the issue on our latest build (based on flutter 2.10.4)

@akindone
Copy link
Contributor

akindone commented Apr 6, 2022

I got the same issue after upgrade to flutter 2.10.3. The issue happens randomly. the device is iOS 15.0.1. This page has a webview which is not flickering, but the appbar is flickering

normal.video.mp4

@danagbemava-nc
Copy link
Member

Hi @akindone, can you provide a small sample that reproduces the issue?

@akindone
Copy link
Contributor

akindone commented Apr 6, 2022

Hi @akindone, can you provide a small sample that reproduces the issue?

I will provide a sample if I can reproduce this issue

@henrychiu
Copy link

henrychiu commented Apr 12, 2022

I have experienced the same problem (both IOS and Android) in two of my apps since the upgrade from 2.8 to 2.10. But the issue happens randomly. so far I cannot isolate and replicate the bug. It happens when the screen either has a lot of images or playing video.

@danagbemava-nc danagbemava-nc changed the title [iOS]screen flickering on Flutter 2.10.0 Screen flickering on Flutter 2.10.0 Apr 12, 2022
@danagbemava-nc danagbemava-nc removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds. label Apr 12, 2022
@danagbemava-nc
Copy link
Member

If anyone else is experiencing this issue, kindly upvote the initial comment on this issue. We would also appreciate it if any
of you experiencing this issue can provide a sample so that we can verify this.

Keeping this issue open to track future reports of the same issue.

Based on what I've gathered:

Once again, if anyone is able to reproduce and isolate the cause, kindly provide a sample so that we can investigate this.

Labeling for visibilty

@danagbemava-nc danagbemava-nc added framework flutter/packages/flutter repository. See also f: labels. will need additional triage This issue or PR needs attention during weekly triage severe: rendering UI glitches reported at the engine/skia rendering level. platform-android Android applications specifically. platform-ios iOS applications specifically. and removed in triage Presently being triaged by the triage team. labels Apr 12, 2022
@jmagman jmagman added the engine flutter/engine repository. See also e: labels. label Apr 12, 2022
@Hixie Hixie added P3 Priority 3 issue (the default for issues we're likely to work on after P0-P2 issues) severe: regression It was better in the past than it is now. and removed will need additional triage This issue or PR needs attention during weekly triage labels Apr 12, 2022
@zanderso
Copy link
Member

@knopp @iskakaushik does this look related to DRM?

@briankariuki
Copy link

I saw it a couple of times with my app on iphone pro 13 ios16

Having the same issue. Any news about this one?

I think we should try impeller. I'll use it for my next release on ios ]

This occurs also with Impeller. We are in test mode pre-launch and we see this issue every day on our iphones. Waiting for the fix before shipping app is mandatory. Hoping you guys get to fix it soon🤞

I havent experienced this with impeller yet. I'll try to do more testing. This issue is very hard to recreate and does not happen all the time. I attached a video in this thread as I experienced it while using the app in release mode

@Brazol
Copy link

Brazol commented Feb 3, 2023

I also experienced it with Impeller once and couldn't reproduce it. I think it was different than on Skia tho because it started blinking with pink tint and at the end just shown pink screen. I did experience this once (pink blinking screen) on Apple's Photos native app on my phone so it's definitely something on native side (but maybe enhanced by Flutter?).

@delfme
Copy link

delfme commented Feb 5, 2023

We use Impeller and blinking is not pink in our case.

For us a fix to this issue and #105093 is key. Without them users would rate app 1-star and uninstall it.

@themartorana
Copy link

themartorana commented Feb 8, 2023

We're experiencing this in our main app with Impeller. Our flashing is pink, for whatever that's worth. We're working to figure out a pattern/trigger and make something reproducible. We're seeing it on a broad range of iPhones, almost all iOS 16.x.

As above, if I jump on Console, we're seeing this log with each flash. Flashing is made worse with touch. Touch makes flashing happen, but touch is broken once we get into this state - that is, scrolling is broken, etc.

0	23852	13:47:41.077922-0500	Execution of the command buffer was aborted due to an error during execution. <private>	Runner

@chinmaygarde
Copy link
Member

If you are experiencing this with the Impeller backend enabled, we have additional logging instrumentation to log the root cause of the error as well as print the debug description of the faulting render pass. You should see the following log line in the console: "Impeller command buffer could not be committed" followed by a bunch of information. Can you paste that information in the logs please.

@jackTang11
Copy link

From Triage: We know from @lcdsmao and @jackTang11 s backtraces that this is an over-release of a Metal command buffer. I am instrumenting our behavior now but the surface area is large. What is peculiar is that @lcdsmao backtrace points to an overrelease on the render thread while @jackTang11 s issue is on the platform thread. We now suspect that this could happen during thread merging and unmerging. This narrows down where we can look for issues. More updates incoming.

Is there any result? Is it being repaired?

@NikosTsesmelis

This comment was marked as off-topic.

@dnfield

This comment was marked as off-topic.

@themartorana
Copy link

If you are experiencing this with the Impeller backend enabled, we have additional logging instrumentation to log the root cause of the error as well as print the debug description of the faulting render pass. You should see the following log line in the console: "Impeller command buffer could not be committed" followed by a bunch of information. Can you paste that information in the logs please.

We will try to do this. Unfortunately we're having issues seeing it at all when attached to a debugger, and it seems to show up mostly on release builds. But we'll keep trying.

@flar
Copy link
Contributor

flar commented Feb 17, 2023

Also, try testing your apps with the following fix (which is now in the engine repo, but hasn't rolled into the Flutter repo yet):

flutter/engine#39690

@zanderso
Copy link
Member

Note that the fix mentioned by @flar (flutter/engine#39690) is for #120455, and won't help when the flickering is caused by GPU faults.

@jackTang11
Copy link

I repeated the problem again and captured the feedback information. The user's operation process:

  1. The user slides up and exits, causing a stuck state
  2. After the screen is locked, it flashes when it is opened again.
  3. It crashes after a period of time

crashlog.txt

feedback.txt

I found in the log that it was caused by pictures. There are indeed a large number of pictures in my app. Please tell me how to solve it

extended_image: ^6.3.4 flutter_svg: ^1.1.6

[✓] Flutter (Channel stable, 3.3.8, on macOS 13.1 22C65 darwin-arm, locale zh-Hans-CN) • Flutter version 3.3.8 on channel stable • Upstream repository https://github.com/flutter/flutter.git • Framework revision 52b3dc2 (7 weeks ago), 2022-11-09 12:09:26 +0800 • Engine revision 857bd6b74c • Dart version 2.18.4 • DevTools version 2.15.0 • Pub download mirror https://pub.flutter-io.cn • Flutter download mirror https://storage.flutter-io.cn

@zanderso My log seems to be caused by threads. Is this related to CPU?

@delfme
Copy link

delfme commented Feb 20, 2023

I confirm we also experienced same flow: app first gets stuck and then flashes when it is opened again.

We also use extented_image and images are almost everywhere inside our app.

@mazhengshui

This comment was marked as duplicate.

@remakerich
Copy link

remakerich commented Mar 3, 2023

I experienced flickering both on iOS Simulator (iOS 16.2) and Android physical device (Galaxy s20 FE).
Flutter 3.3.10

We also use quite a number of svg images around the app.

Btw, svg images drop performance quite a bit. It's very noticeable on 120 hz screen.

@aa1dar
Copy link

aa1dar commented Mar 6, 2023

I experienced appbar flickering after migrating the Flutter version from 2.0.4 to 3.3.10. This happens on physical Pixel 6(Android 13) and Samsung A52s(Android 12, 120 Hz).

We also use multiple WebViews on the same screen.
With flutter 3.7 the same behavior

@chikang
Copy link

chikang commented Mar 14, 2023

I repeated the problem again and captured the feedback information. The user's operation process:

  1. The user slides up and exits, causing a stuck state
  2. After the screen is locked, it flashes when it is opened again.
  3. It crashes after a period of time

crashlog.txt
feedback.txt
I found in the log that it was caused by pictures. There are indeed a large number of pictures in my app. Please tell me how to solve it
extended_image: ^6.3.4 flutter_svg: ^1.1.6
[✓] Flutter (Channel stable, 3.3.8, on macOS 13.1 22C65 darwin-arm, locale zh-Hans-CN) • Flutter version 3.3.8 on channel stable • Upstream repository https://github.com/flutter/flutter.git • Framework revision 52b3dc2 (7 weeks ago), 2022-11-09 12:09:26 +0800 • Engine revision 857bd6b74c • Dart version 2.18.4 • DevTools version 2.15.0 • Pub download mirror https://pub.flutter-io.cn • Flutter download mirror https://storage.flutter-io.cn

@zanderso My log seems to be caused by threads. Is this related to CPU?

Did you finally find out what the problem was and how it was solved?

@dingjianjaja
Copy link

I summarize some recurrence rules:

  1. high refresh rate phone,120hz
  2. used animation,SingleTickerProviderStateMixin
  3. statelessWidget,statefulWidget did not flickering

maybe is TickerProvider problem

@zanderso
Copy link
Member

Hi everyone,

Thanks for your patience on this very difficult issue. As you've likely noticed, this thread has become quite long. It has become so long that GitHub's UI has made it essentially impossible for the team to use it. Additionally, we on the Flutter team have also not done a great job of enforcing Flutter's issue hygiene policies on this issue. This has led to a somewhat low signal to noise ratio. The combination of these factors with our inability to reproduce this issue locally requires a change in tactics. Along those lines, I'm going to close and lock this issue, and replace it with multiple issues that attempt to tease out the different situations discussed in this thread, and focus the conversations on details that will help the team fix the problems. Here they are:

Please note that these issues are focused on recent versions of Flutter as the team will not be able to back-port any fixes to older versions. Please also note that on iOS, any reproduction should be with Impeller enabled.

Thanks again for your help and continued patience!

@zanderso zanderso closed this as not planned Won't fix, can't repro, duplicate, stale Mar 21, 2023
@flutter flutter locked and limited conversation to collaborators Mar 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
customer: crowd Affects or could affect many people, though not necessarily a specific customer. customer: vroom engine flutter/engine repository. See also e: labels. P2 Priority 2 issue likely blocking a tier-1 customer soon. platform-ios iOS applications specifically. severe: regression It was better in the past than it is now. severe: rendering UI glitches reported at the engine/skia rendering level.
Projects
None yet
Development

No branches or pull requests