Flutter:研究较长的构建时间

Flutter: Investigating long build times

我有一个相当大的应用程序,在 Flutter 2 之前的构建时间为 android 大约 8 -10 分钟,而且自从升级后构建时间变得非常长。正如主题所述,我正在尝试弄清楚如何弄清楚为什么会发生这种情况。

记录我疯狂的构建时间之一 https://gist.github.com/glenfordwilliams/f95d75f82a5f7bb1de7d95dddd8859e3

扑博士

[✓] 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.

这是由您的互联网连接速度引起的,因为 gradle 构建需要互联网,而且您的计算机速度也很重要。