Skip to content

Appbundle size increase of 90mb with flutter 3.7.0 without any change #119507

Description

@enricoi

Same app, same files, same configuration. Only change is the upgrade flutter version from 3.3.10 to 3.7.0.

Build with 3.7.0:
✓ Built build/app/outputs/bundle/release/app-release.aab (351.1MB).

Build with 3.3.10
✓ Built build/app/outputs/bundle/release/app-release.aab (260.7MB).

With 3.7.0 is impossible to upload appbundle on play store due to 150mb size limit reached, with 3.3.10 upload complete successfully.

Activity

  1. added
    in triagePresently being triaged by the triage team
    on Jan 30, 2023
  2. exaby73 commented on Jan 30, 2023

    @exaby73
    Member

    Triage report

    I can reproduce this issue. Here's what I found:

    • app-release.aab is 16.5 MB on 3.3.10
    • app-release.aab is 16.8 MB on 3.7.0, on a newly generate project as well as on the project generated with 3.3.10

    I haven't tested it on a large project like OP has but this ~300 KB increase could scale up to a large amount with larger applications.

    flutter doctor -v (Master)
    [!] Flutter (Channel master, 3.7.0-29.0.pre.26, on macOS 13.1 22C65 darwin-arm64, locale en-US)
        • Flutter version 3.7.0-29.0.pre.26 on channel master at /Users/nabeelparkar/fvm/versions/master
        ! Warning: `dart` on your path resolves to /opt/homebrew/Cellar/dart/2.18.6/libexec/bin/dart, which is not inside your current Flutter SDK checkout at /Users/nabeelparkar/fvm/versions/master. Consider adding /Users/nabeelparkar/fvm/versions/master/bin to the front of your path.
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 15cd00f1ed (3 hours ago), 2023-01-29 21:58:05 -0500
        • Engine revision a7bb0e4108
        • Dart version 3.0.0 (build 3.0.0-179.0.dev)
        • DevTools version 2.20.1
        • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
        • Android SDK at /Users/nabeelparkar/Library/Android/sdk/
        • Platform android-33, build-tools 33.0.0
        • ANDROID_SDK_ROOT = /Users/nabeelparkar/Library/Android/sdk/
        • Java binary at: /Users/nabeelparkar/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/213.7172.25.2113.9123335/Android Studio.app/Contents/jre/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 14.2)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Build 14C18
        • CocoaPods version 1.11.3
    
    [✓] Chrome - develop for the web
        • CHROME_EXECUTABLE = /Applications/Brave Browser.app/Contents/MacOS/Brave Browser
    
    [✓] Android Studio (version 2021.3)
        • Android Studio at /Users/nabeelparkar/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/213.7172.25.2113.9123335/Android Studio.app/Contents
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/6351-dart
        • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
    
    [!] Android Studio (version 2022.1)
        • Android Studio at /Users/nabeelparkar/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/221.6008.13.2211.9477386/Android Studio.app/Contents
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/6351-dart
        ✗ Unable to find bundled Java version.
        • Try updating or re-installing Android Studio.
    
    [✓] VS Code (version 1.74.3)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.58.0
    
    [✓] Connected device (2 available)
        • macOS (desktop) • macos  • darwin-arm64   • macOS 13.1 22C65 darwin-arm64
        • Chrome (web)    • chrome • web-javascript • Brave Browser 109.1.47.186
    
    [✓] HTTP Host Availability
        • All required HTTP hosts are available
    
    ! Doctor found issues in 2 categories.
    
  3. added
    toolAffects the "flutter" command-line tool. See also t: labels.
    c: performanceRelates to speed or footprint issues (see "perf:" labels)
    a: buildBuilding flutter applications with the tool
    perf: app sizePerformance issues related to app size (binary/code size) or disk space
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    platform-androidAndroid applications specifically
    and removed
    in triagePresently being triaged by the triage team
    on Jan 30, 2023
  4. jonahwilliams commented on Jan 30, 2023

    @jonahwilliams
    Contributor

    An app bundle size on disk is not representitive of the final sized shipped to an end user application

  5. exaby73 commented on Jan 31, 2023

    @exaby73
    Member

    @jonahwilliams Are you saying that this is an invalid issue?

  6. enricoi commented on Jan 31, 2023

    @enricoi
    Author

    Upon further investigation I find the difference is that up until 3.3.10 files that are in the assets folders but not in the assets list in the pubspec.yaml are not counted within the .aab build. Since 3.7.0 folders that are not in the resource list in pubspec.yaml are still counted and contribute to the final aab build weight

    Is it a wanted behavior? I found it convenient to manage different configurations (i.e. ios/android) the fact of being able to exclude folders by simply omitting them from the assets list in pubspec.yaml

  7. 3 remaining items

  8. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    and removed
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    on Feb 2, 2023
  9. enricoi commented on Feb 2, 2023

    @enricoi
    Author

    Hi @andrewkolos,
    The problem occurs if you use subfolders.

    Steps to reproduce:

    1. create a subfolder images in asset folder and put 2 images inside it (I put grass.jpg and pine.jpg)

    2. build appbundle with flutter 3.7.1 and this assets configuration in pubspec.yaml

      assets:
          - assets/
          - assets/images/
    

    I get ✓ Built build/app/outputs/bundle/release/app-release.aab (33.9MB).

    1. build appbundle with flutter 3.7.1 and this assets configuration in pubspec.yaml without images folder
      assets:
          - assets/
        # - assets/images/
    

    I get ✓ Built build/app/outputs/bundle/release/app-release.aab (33.9MB).

    1. Downgrade flutter to version 3.3.10

    2. build appbundle with flutter 3.3.10 and this asset configuration in pubspec.yaml

      assets:
          - assets/
          - assets/images/
    

    I get ✓ Built build/app/outputs/bundle/release/app-release.aab (33.6MB).

    1. build appbundle with flutter 3.3.10 and this assets configuration in pubspec.yaml without images folder
      assets:
          - assets/
        # - assets/images/
    

    I get ✓ Built build/app/outputs/bundle/release/app-release.aab (23.3MB).

    As you could see app bundle count subfolders in a different way in the two flutter versions.

  10. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Feb 2, 2023
  11. added
    P2Important issues not at the top of the work list
    c: regressionIt was better in the past than it is now
    and removed
    c: performanceRelates to speed or footprint issues (see "perf:" labels)
    on Feb 2, 2023
  12. reidbaker commented on Feb 2, 2023

    @reidbaker
    Contributor

    Thank you for this report. Based on your last comment the work around is to not use subfolders but I can see how this is a painful regression. Added to our list of issues to consider when we have availability.

  13. andrewkolos commented on Feb 2, 2023

    @andrewkolos
    Contributor

    @enricoi, thank you for the detailed repro steps👍. I was able to repro this time around, and I updated the example project I used to repro. I'll start investigating now.

  14. added
    P1High-priority issues at the top of the work list
    and removed
    P2Important issues not at the top of the work list
    on Feb 2, 2023
  15. added
    r: fixedIssue is closed as already fixed in a newer version
    on Feb 8, 2023
  16. github-actions commented on Mar 3, 2023

    @github-actions

    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.

  17. locked as resolved and limited conversation to collaborators on Mar 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work lista: buildBuilding flutter applications with the toolc: regressionIt was better in the past than it is nowfound in release: 3.7Found to occur in 3.7perf: app sizePerformance issues related to app size (binary/code size) or disk spaceplatform-androidAndroid applications specificallyr: fixedIssue is closed as already fixed in a newer versiontoolAffects the "flutter" command-line tool. See also t: labels.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions