Flutter: Investigating long build times

Issue

I have a fairly large app that pre Flutter 2 took ~8 -10 minutes to build for android and since upgrading build times have become ridiculously longer. As the topic states, i’m trying to figure out how to figure out why this is happening.

log from one of my crazy build times
https://gist.github.com/glenfordwilliams/f95d75f82a5f7bb1de7d95dddd8859e3

flutter doctor

[✓] Flutter (Channel stable, 2.0.2, on Linux, locale en_US.UTF-8)
⢿^C[kingwill101@kingtech ~]$ flutter doctor -v
[✓] Flutter (Channel stable, 2.0.2, on Linux, locale en_US.UTF-8)
    • Flutter version 2.0.2 at /opt/flutter
    • Framework revision 8962f6dc68 (4 days ago), 2021-03-11 13:22:20 -0800
    • Engine revision 5d8bf811b3
    • Dart version 2.12.1

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /home/kingwill101/Android/Sdk
    • Platform android-30, build-tools 30.0.3
    • Java binary at: /usr/bin/java
    • Java version OpenJDK Runtime Environment (build 15.0.2+7)
    • All Android licenses accepted.

[✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[✓] Linux toolchain - develop for Linux desktop
    • clang version 11.1.0
    • cmake version 3.19.6
    • ninja version 1.10.2
    • pkg-config version 1.7.3

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/linux#android-setup for detailed instructions).

[✓] IntelliJ IDEA Community Edition (version 2020.3)
    • IntelliJ at /usr/share/idea
    • Flutter plugin version 54.0.3
    • Dart plugin version 203.7759

[✓] Connected device (2 available)
    • sdk gphone x86 (mobile) • emulator-5554 • android-x86 • Android 11 (API 30) (emulator)
    • Linux (desktop)         • linux         • linux-x64   • Linux

! Doctor found issues in 2 categories.

Solution

this is caused by your internet connection speed because gradle build requires internet plus your computer’s speed maters too.

Answered By – biruk IS

Answer Checked By – Mildred Charles (FlutterFixes Admin)

Leave a Reply

Your email address will not be published. Required fields are marked *