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

Widget rendering strange since Flutter update #28484

Closed
dsa28s opened this issue Feb 26, 2019 · 48 comments
Closed

Widget rendering strange since Flutter update #28484

dsa28s opened this issue Feb 26, 2019 · 48 comments
Labels
c: regression It was better in the past than it is now c: rendering UI glitches reported at the engine/skia rendering level customer: penguin dependency: skia Skia team may need to help us engine flutter/engine repository. See also e: labels. platform-ios iOS applications specifically

Comments

@dsa28s
Copy link

dsa28s commented Feb 26, 2019

Hello.
I using the Flutter beta channel, widgets rendered as shown in the picture below after updating from 1.1.8 to 1.2.1.

↓ This screenshot flutter version > beta channel v 1.2.1

↓ This screenshot flutter version > beta channel v 1.1.8 (before update)

Platform : iOS

(Current) Here is my flutter information:

$ flutter doctor -v

[✓] Flutter (Channel beta, v1.2.1, on Mac OS X 10.14.3 18D109, locale en-KR)
    • Flutter version 1.2.1 at /Users/dsa28s/flutter
    • Framework revision 8661d8aecd (11 days ago), 2019-02-14 19:19:53 -0800
    • Engine revision 3757390fa4
    • Dart version 2.1.2 (build 2.1.2-dev.0.0 0a7dcf17eb)

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /Users/dsa28s/AndroidSDK
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • ANDROID_HOME = /Users/dsa28s/AndroidSDK
    • Java binary at: /Users/dsa28s/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/182.5264788/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
    • All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.1, Build version 10B61
    • ios-deploy 1.9.4
    • CocoaPods version 1.5.3

[✓] Android Studio (version 3.3)
    • Android Studio at /Users/dsa28s/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/182.5264788/Android Studio.app/Contents
    • Flutter plugin version 33.1.1
    • Dart plugin version 182.5215
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)

[!] IntelliJ IDEA Ultimate Edition (version 2018.3.4)
    • IntelliJ at /Users/dsa28s/Applications/JetBrains Toolbox/IntelliJ IDEA Ultimate.app
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    • For information about installing plugins, see
      https://flutter.io/intellij-setup/#installing-the-plugins

[✓] VS Code (version 1.31.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 2.23.0

[✓] Connected device (2 available)
    • Pixel 3 XL • XXXXXXXXX                 • android-arm64 • Android 9 (API 28)
    • 도라도라       • XXXXXXXXX • ios           • iOS 12.1.4

! Doctor found issues in 1 category.
@dsa28s dsa28s changed the title Widget rendering error since Flutter update Widget rendering strange since Flutter update Feb 26, 2019
@zoechi zoechi added c: regression It was better in the past than it is now engine flutter/engine repository. See also e: labels. dependency: skia Skia team may need to help us ⚠ TODAY labels Feb 26, 2019
@zoechi zoechi added this to the Goals milestone Feb 26, 2019
@zoechi
Copy link
Contributor

zoechi commented Feb 26, 2019

Can you please provide a minimal runnable reproduction
as a single file so that we can just copy your code into lib/main.dart of a new project and run to reproduce.

@dsa28s
Copy link
Author

dsa28s commented Feb 26, 2019

This page using custom font, and image asset. What can I do?

Here is page file splash-screen.dart

// splash-screen.dart

import 'dart:async' show Timer;
import 'dart:io' show Platform;

import 'package:flutter/material.dart';
import 'package:flutter_redux/flutter_redux.dart';

import 'package:flutter_statusbarcolor/flutter_statusbarcolor.dart';

import 'package:google_sign_in/google_sign_in.dart';

import 'package:maat_pick/redux/application-state.dart';
import 'package:maat_pick/redux/auth/auth-middleware.dart';

class SplashPage extends StatefulWidget {
  @override
  SplashPageState createState() => SplashPageState();
}

class SplashPageState extends State<SplashPage> {
  GoogleSignInAccount _googleAccount;

  @override
  void initState() {
    super.initState();

    Timer(new Duration(seconds: 1), () => checkLogin(context));

    if (Platform.isIOS) {
      FlutterStatusbarcolor.setStatusBarWhiteForeground(true);
    } else {
      FlutterStatusbarcolor.setStatusBarColor(Colors.transparent);
      FlutterStatusbarcolor.setStatusBarWhiteForeground(true);
    }
  }

  @override
  Widget build(BuildContext context) => Scaffold(
        body: Container(
            decoration: BoxDecoration(
                gradient: LinearGradient(
              begin: Alignment.topLeft,
              end: Alignment.bottomRight,
              colors: [const Color(0xffff3fba), const Color(0xffff971f)],
            )),
            child: Stack(
              children: <Widget>[
                Center(
                  child: Column(
                    mainAxisAlignment: MainAxisAlignment.center,
                    children: <Widget>[
                      Image.asset(
                        'assets/icons/icon_splash.png',
                        width: 160,
                      ),
                      Padding(
                        padding: const EdgeInsets.only(top: 16.0),
                        child: Text(
                          '맛픽',
                          style: TextStyle(
                              fontFamily: 'SongMyung',
                              fontWeight: FontWeight.normal,
                              fontSize: 64,
                              color: Colors.white),
                        ),
                      ),
                      Padding(
                          padding: const EdgeInsets.only(bottom: 40),
                          child: Text(
                            'ma’at pick',
                            style: TextStyle(
                                fontFamily: 'Oswald',
                                fontWeight: FontWeight.normal,
                                fontSize: 36,
                                color: Colors.white),
                          )),
                    ],
                  ),
                ),
                Container(
                  alignment: Alignment.bottomCenter,
                  padding: const EdgeInsets.only(bottom: 50),
                  child: SizedBox(
                      width: 160,
                      height: 3,
                      child: DecoratedBox(
                          decoration: BoxDecoration(
                              borderRadius:
                                  BorderRadius.all(const Radius.circular(8.0))),
                          child: LinearProgressIndicator(
                              backgroundColor: Color(0x4dffffff),
                              valueColor: AlwaysStoppedAnimation<Color>(
                                  Colors.white)))),
                )
              ],
            )),
      );

  void checkLogin(BuildContext context) async {
     // check login logic
  }
}

@zoechi
Copy link
Contributor

zoechi commented Feb 26, 2019

Thanks!
You could publish a reduced project to github or just zip the files and upload into a comment

@dsa28s
Copy link
Author

dsa28s commented Feb 26, 2019

ezgif com-resize

I separate the screen with the problem and tested it.
However, it didn't happen.

Attach video.
The first app is currently being developed, and the second app is a separate screen and compiled.

--

So I did a test.

Remove image widget

Image.asset(
    'assets/icons/icon_splash.png',
    width: 160,
),

It didn't happen!!

And add image widget > happening again.

Attach reduced project file.
widget_rendering_error.zip

@zoechi
Copy link
Contributor

zoechi commented Feb 26, 2019

Could you please check if you can reproduce with master channel as well?

flutter channel master
flutter doctor

There was a related fix recently and I don't know if it is included in beta already

Framework revision 8661d8aecd (11 days ago),

@zoechi
Copy link
Contributor

zoechi commented Feb 26, 2019

I was not able to reproduce

[✓] Flutter (Channel master, v1.2.3-pre.47, on Mac OS X 10.14.3 18D42, locale en-AT)
[✓] Connected device (2 available)
    • Pixel XL                  • HT69V0203649  • android-arm64 • Android 9 (API 28)
    • Android SDK built for x86 • emulator-5554 • android-x86   • Android 9 (API 28) (emulator)

but I have not tried iOS

@zoechi zoechi added waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds and removed ⚠ TODAY labels Feb 26, 2019
@dsa28s
Copy link
Author

dsa28s commented Feb 26, 2019

I change flutter master channel.
Here is my flutter information.

[✓] Flutter (Channel master, v1.2.3-pre.50, on Mac OS X 10.14.3 18D109, locale ko-KR)
    • Flutter version 1.2.3-pre.50 at /Users/dsa28s/FlutterSDK
    • Framework revision f460dd60df (3 hours ago), 2019-02-26 08:08:28 -0500
    • Engine revision 9f95ef23aa
    • Dart version 2.2.0 (build 2.2.0-dev.2.1 f7e435ac26)

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /Users/dsa28s/AndroidSDK
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • ANDROID_HOME = /Users/dsa28s/AndroidSDK
    • Java binary at: /Users/dsa28s/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/182.5264788/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
    • All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.1, Build version 10B61
    • ios-deploy 1.9.4
    • CocoaPods version 1.5.3

[✓] Android Studio (version 3.3)
    • Android Studio at /Users/dsa28s/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/182.5264788/Android Studio.app/Contents
    • Flutter plugin version 33.3.1
    • Dart plugin version 182.5215
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)

[!] IntelliJ IDEA Ultimate Edition (version 2018.3.4)
    • IntelliJ at /Users/dsa28s/Applications/JetBrains Toolbox/IntelliJ IDEA Ultimate.app
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    • For information about installing plugins, see
      https://flutter.io/intellij-setup/#installing-the-plugins

[!] VS Code (version 1.31.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    ✗ Flutter extension not installed; install from
      https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (1 available)
    • 도라도라 • XXXXXXXX • ios • iOS 12.1.4

! Doctor found issues in 2 categories.

Tested on multiple devices.

iOS 12.1.4 > Strange widget rendering
iOS 11.3 > Strange widget rendering
iOS 10.2 > Strange widget rendering

Android 9 (Pie) > No problem
Android 8.1 (Oreo) > No Problem
Android 6.0 (Marshmallow) > No Problem

@no-response no-response bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Feb 26, 2019
@tvolkert tvolkert added the platform-ios iOS applications specifically label Feb 26, 2019
@tvolkert
Copy link
Contributor

@dsa28s does this happen in release builds too, or just debug builds (debug builds use software rendering instead of GPU rendering)?

@jason-simmons
Copy link
Member

What device models did the bug reproduce on?

I tried running this using the Flutter master branch on an iPhone 6, iPhone 6S, and iPhone SE. The sample app appeared to render correctly on each of these devices.

@Hixie
Copy link
Contributor

Hixie commented Feb 27, 2019

@dsa28s Is that in the simulator or on a real device or both?

@dsa28s
Copy link
Author

dsa28s commented Feb 27, 2019

I just now, updated the Flutter master channel.
Flutter v 1.2.3-pre.50 → Flutter v 1.2.3-pre.65

[✓] Flutter (Channel master, v1.2.3-pre.65, on Mac OS X 10.14.3 18D109, locale en-KR)
    • Flutter version 1.2.3-pre.65 at /Users/dsa28s/flutter
    • Framework revision 6daad8d0eb (30 minutes ago), 2019-02-26 17:15:39 -0800
    • Engine revision 113b91fe82
    • Dart version 2.2.0 (build 2.2.0-dev.2.1 0f9a5198bd)

ezgif com-gif-maker

Now, It's not a rendering error, it's just a little weird for a second, and rendered normally.
It's not that much of a concern now, but it appears in the release mode as an attached video.

iPhone Xs (iOS 12.1.4)
iPhone 7 (iOS 11.3)
iPhone 6s (iOS 10.2)

Android > Work perfectly.

Not tested simulator.

@marcglasberg
Copy link

A question: Do you use the flutter_svg package?

Also, would you say these 3 following issues are the same problem?
#28484
#22546
#28786

@marcglasberg
Copy link

Also these:
#28227
dnfield/flutter_svg#115

@dsa28s
Copy link
Author

dsa28s commented Mar 3, 2019

I used to flutter_svg library.
After this happened, I thought it was a flutter_svg library problem.
Remove svg library, but it was the same.

@shakir-fattani
Copy link

i also got this issue in release build of iOS.
any update.
8f62c3e2-a0fb-4e8b-9d8c-c83caa71c660

@zazu27
Copy link

zazu27 commented Mar 15, 2019

I am from #29289
All works fine after deleting Image widget. I use png file.

@wilburx9
Copy link

Seems so to me. @csmartdalton86 : has Skia recently disabled CCPR in the master branch which fixes this issue in the Flutter master branch?

@liyuqian Just curious, in this context, please what is CCPR in full?

@liyuqian
Copy link
Contributor

liyuqian commented Mar 15, 2019

CCPR = Coverage Counting Path Rendering, a new vector path rasterization algorithm on GPU.

Its main issue (which is shared by many new algorithms) is skbug.com/6886 (not the glitch here; the glitch here is most likely caused by GPU drivers and probably bugs in their OpenGL implementations).

This was referenced Mar 16, 2019
@dsa28s
Copy link
Author

dsa28s commented Mar 18, 2019

The recent upgrade of the Flutter master channel.
Build in release mode, it was reproduced.

Removing the png image, does not reproduced.
But, re-including the png image, reproduced.

I'm looking at the engine code in case it helps, but it's too complicated. Sorry I didn't help a lot.

Flutter version:

[✓] Flutter (Channel master, v1.3.11-pre.38, on Mac OS X 10.14.3 18D109, locale en-KR)
    • Flutter version 1.3.11-pre.38 at /Users/dsa28s/flutter
    • Framework revision e567f1117a (17 hours ago), 2019-03-17 16:07:34 -0400
    • Engine revision 4d9b9aacd0
    • Dart version 2.2.1 (build 2.2.1-dev.1.0 None)

@dsa28s
Copy link
Author

dsa28s commented Mar 28, 2019

@xster What is that mean label customer: penguin ? 😃

@abogdanovich1
Copy link

abogdanovich1 commented Mar 28, 2019

I am also having this issue with iOS. Got an app rejected from the App Store due to this reason.
I am on the latest Stable build of Flutter (1.2.something I believe).
I've had this issue during development from time to time, and was hoping it was only specific to dev builds, and wouldn't happen on a release build, but it appears it still happens there.

I unfortunately don't have much more info other than this screenshot, and that it seems to be very much related to everyone else having this same issue, but I can provide as much info as I can if you can point me to the right direction.

This image was sent to me by the Apple App Store Review team member

attachment-156757836516287880IMG_0496

I am not at my machine at the moment and can't show my flutter doctor/version output, but will update this comment or attach those when I get home. I have not yet tried building with the master branch, but I am also not able to reliably reproduce this. It happens some times, but not others which makes it really hard to see if switching to the master branch actually helped, or I just got lucky on a few runs.

Either way, I would like to help as much as I can to diagnose this issue so if anyone has some tips on how they've reproduced this bug, please let me know and I'll try to do the same on my machine and see what I can find out!

@tvolkert
Copy link
Contributor

@abogdanovich1 this issue should be fixed on the master channel - can you see if you can reproduce on that channel?

@abogdanovich1
Copy link

abogdanovich1 commented Mar 29, 2019

@tvolkert I will try my best, but as I said in my last comment I'm not even sure how to reliably reproduce it on the Stable channel. I'm gonna attempt to get the issue to pop up at least somewhat reliably in my current build, and switch to master to see if issue goes away.

I'll report back what I find out!

Edit (3/29/19): Launched app on iPhone, and got the glitch again (Stable Channel). Spent the next hour trying to reproduce, to no avail. Switched to master channel, rebuilt the release app, and resubmitted to App Store. Fingers crossed the glitch is gone, or the testers don't encounter it lol.

@michalsuryntequiqo
Copy link

michalsuryntequiqo commented Apr 3, 2019

I have the same issue rendering issue as folks above. After experimenting with different Flutter versions, only channel beta v.1.1.8 seems to be working fine.
The bug happens on master, stable and beta (versions higher than mention above v.1.1.8) channels.
Happens on both Simulator and real device.

Zrzut ekranu 2019-04-03 o 14 14 24

@abogdanovich1
Copy link

After switching to the master channel, I was able to get my app through the review process. Unfortunately, I cannot fully confirm that the bug is fixed, as I was still not reliably able to reproduce the issue prior to switching to master.

When I launched the app once, it glitched immediately upon logging in, but following the exact same steps 23 times afterwards did not trigger the glitch.

@michalsuryntequiqo have you found a way to get this to happen every time if you're using one of the problematic flutter builds?

@michalsuryntequiqo
Copy link

@abogdanovich1 Nope. Using problematic Flutter's versions it works unpredictable and nondeterministic. Sometimes it works fine, sometimes glitches - the same both when debugging app and in the release mode (deployed via TestFlight).
I was also experimenting a lot with widgets hierarchy or switching images used - all with no success.
The only way I found to make it work stable is to use Flutter beta v1.1.8.

@andrea689
Copy link

Also my bug is not present in v1.1.8 #30565

@kevinrodriguez-io
Copy link

kevinrodriguez-io commented Apr 8, 2019

This is happening to me too on iOS Production Releases for Flutter 1.2, i will attach screenshots and logs but it's kinda the same issue everyone here is having.

Please note i did create my project using the -i swift flag (Swift) and i'm using the custom embedded views for Google maps; also i'm using Fontawesome icons and flare.

@liyuqian
Copy link
Contributor

liyuqian commented Apr 8, 2019

Flutter 1.2 still has CCPR enabled. CCPR was disabled in Flutter 1.4.0 so please try to see if the issue is still in 1.4.0 or in the master branch.

If the issue can still be reproduced in 1.4.0 or master, then getting an SKP screenshot by flutter screenshot --type=skia --observatory-port=<observatory_port_from_flutter_run> would be helpful for us to diagnose the problem.

@liyuqian liyuqian added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Apr 8, 2019
@liyuqian
Copy link
Contributor

liyuqian commented Apr 8, 2019

Also, the CCPR's glitch was introduced around 01/07/0219 (https://skia.googlesource.com/skia.git/+/351e80cc28ff6fff947d4272f4792e40615f07ed) so v1.18 (released on 01/08/2019, which probably didn't pick up Skia's change on 01/07 yet) and earlier versions are expected to not have such glitches.

@liyuqian liyuqian added the c: rendering UI glitches reported at the engine/skia rendering level label Apr 8, 2019
@metizror
Copy link

Switch to flutter channel "master" resolved my issue.

Just followed below steps:
flutter channel master
flutter upgrade

@chinmaygarde
Copy link
Member

We think this thread described two issues:

  • Rendering regressions caused by CCPR.
  • Incorrect management of resource context on iOS.

CCPR has been disabled and the iOS issue fixed. Closing.

@cwwng
Copy link

cwwng commented Jun 24, 2019

Can you provide a specific version number of the Flutter that has solved this problem? Thank you.

@pedromassangocode pedromassangocode removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Dec 30, 2020
@github-actions
Copy link

github-actions bot commented Aug 7, 2021

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
c: regression It was better in the past than it is now c: rendering UI glitches reported at the engine/skia rendering level customer: penguin dependency: skia Skia team may need to help us engine flutter/engine repository. See also e: labels. platform-ios iOS applications specifically
Projects
None yet
Development

No branches or pull requests