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

Animations running very slow on some devices? #20233

Closed
shaheenzahedi opened this issue Aug 5, 2018 · 12 comments
Closed

Animations running very slow on some devices? #20233

shaheenzahedi opened this issue Aug 5, 2018 · 12 comments
Labels
a: animation Animation APIs c: performance Relates to speed or footprint issues (see "perf:" labels) e: device-specific Only manifests on certain devices engine flutter/engine repository. See also e: labels. framework flutter/packages/flutter repository. See also f: labels. P2 Important issues not at the top of the work list platform-android Android applications specifically

Comments

@shaheenzahedi
Copy link

shaheenzahedi commented Aug 5, 2018

I have tested my app on about ten android devices, and I don't know why on some devices it executes animation really slow, and on some devices it executes just fine, and it's not about the API level it's not about the GPU, but the overall result in some devices is majorly different.
for example here is the list

It is a branch of this github repository: https://github.com/amirh/indux/tree/master/examples/2048

  • Galaxy j7 2016 (smooth)
  • Xperia Z3 (slow)
  • Huawei Hol-u19 (fine)
  • Galaxy Tab S2 (terrible)
  • Techno W1 dual sim (good)

I have no idea why.

Here is my code for animations, in case if it can help you guys:

 Animation<Alignment> alignment = new Tween(
            begin: new Alignment(fromXPosition, fromYPosition),
            end: new Alignment(toXPosition, toYPosition))
        .animate(new CurvedAnimation(
      curve: Curves.linear,
      parent: slideController,
    ));
    slideController.forward();

    Animation<double> fadeAnimation;
    if (fadeIn) {
      fadeAnimation =
          new CurvedAnimation(parent: fadeController, curve: Curves.linear);
      fadeController.forward();
    } else {
      fadeAnimation = new AlwaysStoppedAnimation(1.0);
    }
    return new AlignTransition(
        child: new FractionallySizedBox(
          widthFactor: 0.25,
          heightFactor: 0.25,
          child: new FadeTransition(
            opacity: fadeAnimation,
            child: new Tile(value),
          ),
        ),
        alignment: alignment);

I uploaded a video of profile mode with graph:https://youtu.be/YoLSupCjMIc

Flutter Doctor:

[√] Flutter (Channel beta, v0.5.1, on Microsoft Windows [Version 10.0.15063], locale fa-IR)
• Flutter version 0.5.1 at C:\Users\Shaheen\AppData\Local\Android\flutter
• Framework revision c7ea3ca (3 months ago), 2018-05-29 21:07:33 +0200
• Engine revision 1ed25ca7b7
• Dart version 2.0.0-dev.58.0.flutter-f981f09760

[√] Android toolchain - develop for Android devices (Android SDK 27.0.3)
• Android SDK at C:\Users\Shaheen\AppData\Local\Android\sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-27, build-tools 27.0.3
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)
• All Android licenses accepted.

[√] Android Studio (version 3.1)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 27.1.1
• Dart plugin version 173.4700
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)

[√] IntelliJ IDEA Community Edition (version 2018.1)
• IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2018.1.4
• Flutter plugin version 24.2.2
• Dart plugin version 181.4892.1

[√] Connected devices (1 available)
• SM J710F • 5203e3d8ee4e638d • android-arm • Android 7.0 (API 24)

• No issues found!
@shakil807g
Copy link

i was a release build or debug ??

@shaheenzahedi
Copy link
Author

@shakil807g Of course it was on release mode, I uploaded a video you can see it

@amirh
Copy link
Contributor

amirh commented Aug 5, 2018

A shot in the dark - it might be the same issue as #13736.
Can you check if it's still slow without the fade transition?

@shaheenzahedi
Copy link
Author

@amirh thanks for your answer sir, I disabled the fade animation but it still slow specially on devices with bigger screens, for example that video was for a 10-inch tablet, I basically tried everything I could think of, you guys are my only hope now :(

@zoechi zoechi changed the title Animatins running very slow on some devices? Animations running very slow on some devices? Aug 24, 2018
@zoechi
Copy link
Contributor

zoechi commented Aug 24, 2018

Please add the output of flutter doctor -v.

@zoechi zoechi added e: device-specific Only manifests on certain devices platform-android Android applications specifically c: performance Relates to speed or footprint issues (see "perf:" labels) labels Aug 24, 2018
@zoechi zoechi added this to the Goals milestone Aug 24, 2018
@shaheenzahedi
Copy link
Author

shaheenzahedi commented Aug 24, 2018

@zoechi Although I think it has something to do, with FractionallySizedBox which calculates the fraction on every tick of animation, so as the device gets bigger it has bigger numbers to deal with.
Now I'm using AnimatedBuilder which passes the pre-built FractionallySizedBox as a child everytime the animation ticks, it has improved a bit, but still slow I don't know why?

@zoechi
Copy link
Contributor

zoechi commented Aug 24, 2018

I don't have good knowledge here. Someone else will need to have a look.

Please add the output of flutter doctor -v to make it easier to understand your environment when trying to diagnose.

@zoechi zoechi added a: animation Animation APIs framework flutter/packages/flutter repository. See also f: labels. engine flutter/engine repository. See also e: labels. labels Dec 6, 2018
@jmagman jmagman added this to Awaiting Triage in Mobile - Android performance review Feb 25, 2020
@AteqEjaz
Copy link

AteqEjaz commented Mar 28, 2020

Hi,

Also Experiencing Extremely slow page Navigation, here is the out put for flutter doctor -v

Users-MacBook-Pro:insocity user$ flutter doctor -v
[✓] Flutter (Channel stable, v1.12.13+hotfix.7, on Mac OS X 10.14.6 18G103, locale en-PK)
• Flutter version 1.12.13+hotfix.7 at /Users/user/flutter-dev/flutter
• Framework revision 9f5ff23 (9 weeks ago), 2020-01-26 22:38:26 -0800
• Engine revision a677925
• Dart version 2.7.0

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.0)
• Android SDK at /Users/user/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.0
• 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.7.3

[✓] Android Studio (version 3.5)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 39.0.3
• Dart plugin version 191.8423
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)

[✓] IntelliJ IDEA Community Edition (version 2019.1.3)
• IntelliJ at /Applications/IntelliJ IDEA CE.app
• Flutter plugin version 37.0.3
• Dart plugin version 191.7830

[✓] Connected device (1 available)
• TECNO KC2 • 045652599A008882 • android-arm64 • Android 9 (API 28)

Any thoughts?

Thanks :)

@kf6gpe kf6gpe added the P2 Important issues not at the top of the work list label May 29, 2020
@DhavalRKansara
Copy link

I am also facing the same issues for slow animation in the flutter.
When I run the transform animation in the iPhone 8 simulator it working smoothly and faster and when I run the same code for the iPhone 11 it is working very slowly.

@Hixie Hixie removed this from the None. milestone Aug 17, 2020
@darshankawar
Copy link
Member

Hi @shaheenzahedi,
I tried to replicate the issue on latest stable (1.20.3) using a demo animation code sample on Android 8.1.0 device in release mode and it appeared to work well, ie, didn't notice slowness in animation.

20233.mp4.zip

Code sample used : https://github.com/flutter-devs/flutter_animation_example

Can you confirm at your end if this is still an issue ?
Thanks.

@darshankawar darshankawar added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Sep 8, 2020
@darshankawar
Copy link
Member

Without additional information, we are unfortunately not sure how to resolve this issue.
We are therefore reluctantly going to close this bug for now.
Please don't hesitate to comment on the bug if you have any more information for us; we will reopen it right away!
Thanks for your contribution.

Could everyone who still has this problem please file a new issue with the exact description of what happens, logs, and the output of flutter doctor -v.
All system setups can be slightly different, so it's always better to open new issues and reference related issues.

Mobile - Android performance review automation moved this from Awaiting triage to Engineer reviewed Sep 30, 2020
@darshankawar darshankawar removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Sep 30, 2020
@github-actions
Copy link

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 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: animation Animation APIs c: performance Relates to speed or footprint issues (see "perf:" labels) e: device-specific Only manifests on certain devices engine flutter/engine repository. See also e: labels. framework flutter/packages/flutter repository. See also f: labels. P2 Important issues not at the top of the work list platform-android Android applications specifically
Projects
Development

No branches or pull requests

9 participants