Open nvbln opened 5 years ago
@nvbln Do you still experience it? Please provide your flutter doctor -v output.
@nvbln Do you still experience it? Please provide your flutter doctor -v output.
Met with this bug. My application have Timer.periodic with duration 70 ms, after I hide application to the background and open it again I see 1-2 black flicker. In the thread I update StatefulWidget widget by call setState ({}); method. But when I delete thread - all right.
In the debug version I see flickers every time when I hide and open application again (through the icon on the home screen).
In the release and debug versions I see 1-2 flickers in the recent applications overview screen (after I hide application). In the relase version I see flickers only in 10% of cases (quite rarely).
In the debug version flicker average duration is 400-700 ms. In the release version average duration - from 100 ms to 300 ms.
The code that causes the error:
timerClock = Timer.periodic(new Duration(milliseconds: 70), (timer) { setState(() { }); });
[✓] Flutter (Channel stable, v1.9.1+hotfix.5, on Linux, locale en_US.UTF-8) • Flutter version 1.9.1+hotfix.5 at /home/XXXX/app/flutter • Framework revision 1aedbb1835 (3 weeks ago), 2019-10-17 08:37:27 -0700 • Engine revision b863200c37 • Dart version 2.5.0
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3) • Android SDK at /home/XXXX/Android/Sdk • Android NDK location not configured (optional; useful for native profiling support) • Platform android-28, build-tools 28.0.3 • Java binary at: /home/XXXX/app/android-studio/jre/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405) • All Android licenses accepted.
[✓] Android Studio (version 3.5) • Android Studio at /home/XXXX/app/android-studio • Flutter plugin version 40.2.2 • Dart plugin version 191.8593 • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
[✓] Connected device (1 available) • XXXXX • XXXXXXX • android-arm64 • Android 9 (API 28)
• No issues found! Process finished with exit code 0
Hi @BondarenkoStas , I do still experience this issue. The launch_screen.xml flickers for a tiny tiny fraction of a second when I return to the app from a different app.
Hi @Goopher
could you please provide your updated flutter doctor -v
and your flutter run --verbose
and a reproducible minimal code sample
or the steps to reproduce the problem.
Thank you
@iapicca
The issue happens on my personal device (OnePlus 6T), I don't experience it in the emulator. I have the issue both in release and debug mode.
I have setup an Android launch screen in the following way:
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<bitmap
android:gravity="fill_vertical"
android:src="@drawable/image" />
</item>
</layer-list>
And everytime I reload the app after switching this happens. The flickering image that pops up is the drawable from the launch screen by the way.
See attached gif:
flutter doctor -v:
[✓] Flutter (Channel stable, v1.12.13+hotfix.5, on Mac OS X 10.15.2 19C57, locale en-NL) • Flutter version 1.12.13+hotfix.5 at /Users/XXXXX/Development/flutter • Framework revision 27321ebbad (5 weeks ago), 2019-12-10 18:15:01 -0800 • Engine revision 2994f7e1e6 • Dart version 2.7.0
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2) • Android SDK at /Users/XXXXX/Library/Android/sdk • Android NDK location not configured (optional; useful for native profiling support) • Platform android-29, build-tools 29.0.2 • Java binary at: /Users/XXXXX/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/191.6010548/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405) • All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1) • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 11.3.1, Build version 11C504 • CocoaPods version 1.8.4
[✓] Android Studio (version 3.5) • Android Studio at /Users/XXXXX/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/191.6010548/Android Studio.app/Contents • Flutter plugin version 42.1.1 • Dart plugin version 191.8593 • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
[✓] Android Studio • Android Studio at /Users/XXXXX/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-1/193.6085562/Android Studio 4.0 Preview.app/Contents • Flutter plugin version 39.0.5 • Dart plugin version 193.2956.37 • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
[✓] VS Code (version 1.41.1) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.7.1
[✓] Connected device (2 available) • ONEPLUS 6T • XXXXX • android-arm64 • Android 10 (API 29) • Android SDK built for x86 • XXXXX • android-x86 • Android 10 (API 29) (emulator)
• No issues found!
+1
i have this problem on android 8
I'm seeing an obvious blink after foregrounding a Flutter app on Android 7, 8, and 9 emulators. The blink doesn't appear on Android 10 afaik... I haven't tried yet on physical devices or on Android versions below 7.1.1 (Nougat).
I'm just backgrounding the app with the home button and then opening again through the app's icon in the app tray.
flutter doctor -v:
[✓] Flutter (Channel stable, v1.12.13+hotfix.8, on Mac OS X 10.15.3 19D76, locale en-US) • Flutter version 1.12.13+hotfix.8 at /Users/ryanjones/Development/Flutter/flutter • Framework revision 0b8abb4724 (6 weeks ago), 2020-02-11 11:44:36 -0800 • Engine revision e1e6ced81d • Dart version 2.7.0
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2) • Android SDK at /Users/ryanjones/Library/Android/sdk • Android NDK location not configured (optional; useful for native profiling support) • Platform android-29, build-tools 29.0.2 • ANDROID_HOME = /Users/ryanjones/Library/Android/sdk • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405) • All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1) • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 11.3.1, Build version 11C504 • CocoaPods version 1.8.0
[✓] Android Studio (version 3.5) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin version 43.0.1 • Dart plugin version 191.8593 • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
[✓] VS Code (version 1.40.2) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.6.0
[✓] Connected device (1 available) • Android SDK built for x86 • emulator-5554 • android-x86 • Android 8.1.0 (API 27) (emulator)
• No issues found!
+1
I was facing this issue but it goes away if you run in release mode
flutter run --release
Cross-posting from #27449:
I just reproduced this on latest master, happening in debug, profile, and release, tested on a Pixel 2 and the emulator. The screen briefly flashes when selecting the app from the multi tasking window. It does not seem to happen when switching apps via 'double-click-on-recents', at least it is not visible then.
Also, this does not seem to be the launch screen, since I set the launch screen to be opaque red and the flash is dark-ish, so it looks to me like it might be just one or two black frames maybe?
Sample:
flutter-doctor:
[✓] Flutter (Channel master, v1.17.1-pre.23, on Linux, locale en_US)
• Flutter version 1.17.1-pre.23 at /opt/flutter
• Framework revision a2e6c30b44 (17 hours ago), 2020-04-03 20:26:01 -0700
• Engine revision 09bc1fc45e
• Dart version 2.8.0 (build 2.8.0-dev.20.0 e736495eb7)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at /home/developer/android-sdk
• Platform android-29, build-tools 29.0.2
• ANDROID_HOME = /home/developer/android-sdk
• ANDROID_SDK_ROOT = /home/developer/android-sdk
• Java binary at: /opt/android-studio/jre/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
• All Android licenses accepted.
[✓] Android Studio (version 3.5)
• Android Studio at /opt/android-studio
• Flutter plugin version 42.1.1
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
[✓] Connected device (1 available)
• Pixel 2 • 192.168.1.31:5555 • android-arm64 • Android 10 (API 29)
/cc @matthew-carroll since you looked into this in #47903 and solved part of the issue already (which made the flash take even longer or there was an additional flash).
Hi
I'm not sure if this is a separate issue or part of this one. I have just updated my app and it has been released for test (production build). I am seeing an issue on Android 9 (Moto G6) when the app is minimised. There is a very noticeable flicker. I have recorded it and slowed it down and it is a black bar scanning down the screen. It happens consistently, and only on minimising.
I have a video of this issue.
I have upgraded to Flutter v1.17 and added a background image in this release. I can't think of anything else that might have caused this change.
I don't see this issue on Android 10 in a virtual device, nor on a physical device running (cough) Android 6, nor on an iOS device. I can't recreate it on Android 9 using a virtual device.
To be sure, this problem is caused by SurfaceView's caching mechanism
I can also confirm the issue with Flutter 1.17.3 and Android 9 (real device).
This seems to happen for every flutter app, even the demo counter app, release mode does not change anything.
I hope a workaround will be found because it looks bad.
and this video
Having same issue here with Moto G6 plus and android 9. Also, on multitasking it flashes multiple times, and screen is black (without the preview, I don't no if this is related to this or other bug). App is using latest flutter version and in release mode.
See video https://drive.google.com/file/d/1lX83DgrUEohZFmesWisRK878CQYA5MsG/view?usp=sharing
PS: Just installed Flutter Gallery from play store, and I have the exact same behavior as in the video I linked.
I still facing this issue with Flutter 1.22.0
I still facing this issue with Flutter 1.22.0
and me too
I still facing this issue with Flutter 1.22.0
same here
@truyenjc @MahdiPishguy @valtlfelipe
I was facing this issue but it goes away if you run in release mode
flutter run --release
does it occur in release mode?
can you provide you flutter doctor -v
tagging @TahaTesser for visibility
@iapicca It does occur on release mode, on every app (even the demo counter app). I still confirm the issue on Flutter 1.22.1.
[✓] Flutter (Channel stable, 1.22.1, on Linux, locale fr_FR.UTF-8)
• Flutter version 1.22.1 at /usr/share/flutter
• Framework revision f30b7f4db9 (il y a 8 jours), 2020-10-08 10:06:30 -0700
• Engine revision 75bef9f6c8
• Dart version 2.10.1
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at /home/alex/Android/Sdk
• Platform android-30, build-tools 29.0.2
• ANDROID_HOME = /home/alex/Android/Sdk
• Java binary at: /home/alex/android/android-studio/jre/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
• All Android licenses accepted.
[✓] Android Studio (version 4.0)
• Android Studio at /home/alex/android/android-studio
• Flutter plugin version 46.0.2
• Dart plugin version 193.7361
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
[!] VS Code (version 1.50.0)
• VS Code at /usr/share/code
✗ Flutter extension not installed; install from
https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[!] Connected device
! No devices available
! Doctor found issues in 2 categories.
@iapicca
@alex-min yes you right, i have this problem with all of application which built with Flutter
and with all of versions which released til now :(
@iapicca It does occur on release mode, on every app (even the demo counter app). I still confirm the issue on Flutter 1.22.1.
I still facing this issue with Flutter 1.22.3, event at Flutter Demo Project. Anyone has solutions or ideas?
I'm facing same issue, any solution?
I still facing this issue with Flutter 1.22.3, event at Flutter Demo Project. Anyone has solutions or ideas?
https://github.com/flutter/flutter/issues/59552 This link solve the flicker issue!!! 🎉 🎉 🎉
I am able to replicate this on Android emulator Pixel 3XL (although not consistently, but yes I did see flickering of flutter app while switching between app overviews).
@darshankawar
did you try this solution? https://github.com/flutter/flutter/issues/59552#issuecomment-713374392
I think this problem will be only for debug run and can solve it by profile run .
I think this problem will be only for debug run and can solve it by profile run .
it doesn't correct, we have this problem in all of release types
Profile run does not solve the issue as mentioned already multiple times in this thread.
This issue happens for every app (even the default demo counter app), in every profile mode (including release) and is still there on Flutter latest stable (2.2.3) as I write those lines. Tested using a Galaxy J3 Pro with Android 9.
Device: Redmi 9T Android 10
Yes
I'm still experiencing this issue as of today. If anyone has found a valid workaround for this issue please leave a link or explain the workaround for this.
same here
This maybe a performance issue using svg can affect the performance . I faced the same issue so here I come with the solution . I have developed a tool called svg2flutter . this tool will convert the svg file as flutter code . by using this we can overcome this kind of performance issue . I am just planning to change this project as open source feel free to reach me if you want to join with my project .
try it out the tool: https://svg2widget.web.app/ performance metrics : https://github.com/maheshwaran-p/samplesvg/
I verified a similar issue yesterday https://github.com/flutter/flutter/issues/59552 which is replicable on latest stable and master versions.
This happens regardless of build type (release, debug, profile), it happens with the standard hello world application, and has been happening for years.
any solution to this?
Have visited all my known Flutter apps that are in PlayStore right now, all have this flickering issue. I personally noticed that today during development. Would like to hear from Flutter team what is the status, as it seems this issue is 4 years old.
The status as I understand it is that we haven't been able to reproduce it in a development environment. If you are able to reproduce it reliably we would greatly appreciate your help in tracking it down. What device do you see it on, what version of the OS, can you give us a precise main.dart
file that shows the problem, what steps do you use to reproduce it reliably, etc?
Google Pixel 6a Android 13 Flutter 3.13.5 As you can see in video, when switching to native Android apps there is no flicker, when switching to flutter apps it has slight black flicker. It happens in release apps also
As for main.dart
it doesn't matter, I just tried creating new Flutter counter project, it happens there also (tried on Android Studio Emulator)
https://github.com/flutter/flutter/assets/25333580/12ed0c2b-c755-407f-8f63-993ff392cf48
Any solution for this issue?
If I send app to background, then bring to foreground after a few minutes, the screen stays black. But, upon seeing the black screen, if I immediately send back to background and bring to foreground, it is normal again. Very reproducible. Also, if I do not delay too long, the app comes back up normally after sending to background. It may have to do with my timers, IDK.
I even tried adding the whole "WidgetsBinding.instance.addObserver(this)" and attempted to stop and restart my timers in didChangeDependencies, but the problem persists. Although, my timers do start and stop nicely :-)
It looks like asset images flicker as well. It doesn't seem to happen for built-in icons or text.
When will there be a normal solution to this problem? This problem is still reproducible! 😠 If there is no solution in flutter engine, please provide at least a temporary solution. Solutions with setting View on top of SurfaceView do not give anything, since SurfaceView overlaps them + this is a very big crutch that creates ugly UI jumps during the resume of the application.
When switching between apps to an app created by flutter on an Android 9.0 device, there might be a short shadowy (so the screen is not completely black) flicker of the screen that the app shows.
This can be reproduced by any app as far as I am aware.
flutter create app
followed bycd app
andflutter run
on an Android 9.0 device (it might also affect other versions, I have not tested it on any other devices, but I heard that other people are able to reproduce it on their device).