Repository navigation
Appbundle size increase of 90mb with flutter 3.7.0 without any change #119507
Description
Activity
- addedfrom: performance templateIssues created via a performance issue templateIssues created via a performance issue template
on Jan 30, 2023 - removedfrom: performance templateIssues created via a performance issue templateIssues created via a performance issue template
on Jan 30, 2023 - addedin triagePresently being triaged by the triage teamPresently being triaged by the triage team
on Jan 30, 2023 Triage report
I can reproduce this issue. Here's what I found:
app-release.aabis 16.5 MB on 3.3.10app-release.aabis 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.- addedtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.c: performanceRelates to speed or footprint issues (see "perf:" labels)Relates to speed or footprint issues (see "perf:" labels)a: buildBuilding flutter applications with the toolBuilding flutter applications with the toolperf: app sizePerformance issues related to app size (binary/code size) or disk spacePerformance issues related to app size (binary/code size) or disk spacehas reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onfound in release: 3.7Found to occur in 3.7Found to occur in 3.7platform-androidAndroid applications specificallyAndroid applications specificallyand removedin triagePresently being triaged by the triage teamPresently being triaged by the triage team
on Jan 30, 2023 An app bundle size on disk is not representitive of the final sized shipped to an end user application
Reacted by Francesco Iapicca, Fareez Iqmal, Albert Mañosa and Naimul Kabir@jonahwilliams Are you saying that this is an invalid issue?
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
3 remaining items
- addedwaiting for responseThe Flutter team cannot make further progress on this issue until the original reporter respondsThe Flutter team cannot make further progress on this issue until the original reporter respondsand removedhas reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work on
on Feb 2, 2023 Hi @andrewkolos,
The problem occurs if you use subfolders.Steps to reproduce:
-
create a subfolder images in asset folder and put 2 images inside it (I put grass.jpg and pine.jpg)
-
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).
- 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).
-
Downgrade flutter to version 3.3.10
-
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).
- 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.
Reacted by Edwin LiuReacted by Albert Mañosa-
- removedwaiting for responseThe Flutter team cannot make further progress on this issue until the original reporter respondsThe Flutter team cannot make further progress on this issue until the original reporter responds
on Feb 2, 2023 - addedP2Important issues not at the top of the work listImportant issues not at the top of the work listc: regressionIt was better in the past than it is nowIt was better in the past than it is nowand removedc: performanceRelates to speed or footprint issues (see "perf:" labels)Relates to speed or footprint issues (see "perf:" labels)
on Feb 2, 2023 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.
Reacted by enricoi and Albert Mañosa@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.
Reacted by enricoi, Reid Baker and Albert Mañosa- addedP1High-priority issues at the top of the work listHigh-priority issues at the top of the work listand removedP2Important issues not at the top of the work listImportant issues not at the top of the work list
on Feb 2, 2023 - addedr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer version
on Feb 8, 2023 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 -vand a minimal reproduction of the issue.- locked as resolved and limited conversation to collaborators
on Mar 3, 2023
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.