Skip to content

--build-name is ignored on linux #152236

Closed

Description

@madadam

Steps to reproduce

The --build-name argument of flutter build seems to have no effect on linux. When passing e.g., --build-name=4.5.6, I expect the generated version.json to contain ... "version":"4.5.6" .... Instead it contains "1.0.0" which is the default value from pubspec.yaml. Steps to reproduce:

flutter create foo --platforms linux
cd foo
flutter build linux --build-name=4.5.6
cat build/linux/x64/release/bundle/data/flutter_assets/version.json

Expected results

{"app_name":"foo","version":"4.5.6","build_number":"1","package_name":"foo"}

Actual results

{"app_name":"foo","version":"1.0.0","build_number":"1","package_name":"foo"}

Code sample

Code sample
// This can be reproduced on the initial app generated with flutter create with no further modification

Logs

Logs
> flutter --verbose build linux --build-name=4.5.6

[  +13 ms] executing: uname -m
[  +10 ms] Exit code 0 from: uname -m
[        ] x86_64
[  +41 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[        ] Artifact Instance of 'LegacyCanvasKitRemover' is not required, skipping update.
[   +1 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[  +38 ms] Artifact Instance of 'MaterialFonts' is not required, skipping update.
[        ] Artifact Instance of 'GradleWrapper' is not required, skipping update.
[        ] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[        ] Artifact Instance of 'LegacyCanvasKitRemover' is not required, skipping update.
[        ] Artifact Instance of 'FlutterSdk' is not required, skipping update.
[        ] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FontSubsetArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'PubDependencies' is not required, skipping update.
[  +64 ms] Skipping pub get: version match.
[ +146 ms] Building Linux application...
[   +3 ms] executing: [build/linux/x64/release/] cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DFLUTTER_TARGET_PLATFORM=linux-x64 /home/adam/projects/equalit.ie/sandbox/flutter/foo/linux
[  +32 ms] -- Configuring done (0.0s)
[        ] -- Generating done (0.0s)
[   +7 ms] -- Build files have been written to: /home/adam/projects/equalit.ie/sandbox/flutter/foo/build/linux/x64/release
[   +7 ms] executing: ninja -C build/linux/x64/release install
[   +5 ms] ninja: Entering directory `build/linux/x64/release'
[+1061 ms] [1/5] Generating /home/adam/projects/equalit.ie/sandbox/flutter/foo/linux/flutter/ephemeral/libflutter_linux_gtk.so,
/home/adam/projects/equalit.ie/sandbox/flutter/foo/linux/flutter/ephemeral/flutter_linux/fl_basic_message_channel.h,
/home/adam/projects/equalit.ie/sandbox/flutter/foo/linux/flutter/ephemeral/flutter_linux/fl_binary_codec.h,
/home/adam/projects/equalit.ie/sandbox/flutter/foo/linux/flutter/ephemeral/flutter_linux/fl_binary_messenger.h,
/home/adam/projects/equalit.ie/sandbox/flutter/foo/linux/flutter/ephemeral/flutter_linux/fl_dart_project.h,
/home/adam/projects/equalit.ie/sandbox/flutter/foo/linux/flutter/ephemeral/flutter_linux/fl_engine.h,
/home/adam/projects/equalit.ie/sandbox/flutter/foo/linux/flutter/ephemeral/flutter_linux/fl_json_message_codec.h,
/home/adam/projects/equalit.ie/sandbox/flutter/foo/linux/flutter/ephemeral/flutter_linux/fl_json_method_codec.h,
/home/adam/projects/equalit.ie/sandbox/flutter/foo/linux/flutter/ephemeral/flutter_linux/fl_message_codec.h,
/home/adam/projects/equalit.ie/sandbox/flutter/foo/linux/flutter/ephemeral/flutter_linux/fl_method_call.h,
/home/adam/projects/equalit.ie/sandbox/flutter/foo/linux/flutter/ephemeral/flutter_linux/fl_method_channel.h,
/home/adam/projects/equalit.ie/sandbox/flutter/foo/linux/flutter/ephemeral/flutter_linux/fl_method_codec.h,
/home/adam/projects/equalit.ie/sandbox/flutter/foo/linux/flutter/ephemeral/flutter_linux/fl_method_response.h,
/home/adam/projects/equalit.ie/sandbox/flutter/foo/linux/flutter/ephemeral/flutter_linux/fl_plugin_registrar.h,
/home/adam/projects/equalit.ie/sandbox/flutter/foo/linux/flutter/ephemeral/flutter_linux/fl_plugin_registry.h,
/home/adam/projects/equalit.ie/sandbox/flutter/foo/linux/flutter/ephemeral/flutter_linux/fl_standard_message_codec.h,
/home/adam/projects/equalit.ie/sandbox/flutter/foo/linux/flutter/ephemeral/flutter_linux/fl_standard_method_codec.h,
/home/adam/projects/equalit.ie/sandbox/flutter/foo/linux/flutter/ephemeral/flutter_linux/fl_string_codec.h,
/home/adam/projects/equalit.ie/sandbox/flutter/foo/linux/flutter/ephemeral/flutter_linux/fl_value.h,
/home/adam/projects/equalit.ie/sandbox/flutter/foo/linux/flutter/ephemeral/flutter_linux/fl_view.h,
/home/adam/projects/equalit.ie/sandbox/flutter/foo/linux/flutter/ephemeral/flutter_linux/flutter_linux.h, _phony_
[   +7 ms] [  +10 ms] executing: uname -m
[        ] [   +9 ms] Exit code 0 from: uname -m
[        ] [        ] x86_64
[        ] [  +33 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[        ] [        ] Artifact Instance of 'LegacyCanvasKitRemover' is not required, skipping update.
[        ] [   +1 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[        ] [  +70 ms] Artifact Instance of 'MaterialFonts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'GradleWrapper' is not required, skipping update.
[        ] [        ] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[        ] [        ] Artifact Instance of 'LegacyCanvasKitRemover' is not required, skipping update.
[        ] [        ] Artifact Instance of 'FlutterSdk' is not required, skipping update.
[        ] [        ] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] [   +1 ms] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[        ] [        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'FontSubsetArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'PubDependencies' is not required, skipping update.
[        ] [  +18 ms] Initializing file store
[        ] [   +8 ms] Done initializing file store
[        ] [  +36 ms] Skipping target: native_assets
[        ] [   +1 ms] Skipping target: gen_localizations
[        ] [   +1 ms] Skipping target: gen_dart_plugin_registrant
[        ] [ +188 ms] Skipping target: unpack_linux
[        ] [ +258 ms] Skipping target: kernel_snapshot
[        ] [  +21 ms] Skipping target: aot_elf_release
[        ] [  +20 ms] Skipping target: linux_aot_bundle
[        ] [  +33 ms] Skipping target: release_bundle_linux-x64_assets
[        ] [        ] Persisting file store
[        ] [   +6 ms] Done persisting file store
[        ] [   +4 ms] build succeeded.
[        ] [   +6 ms] "flutter assemble" took 688ms.
[        ] [   +2 ms] Running 0 shutdown hooks
[        ] [        ] Shutdown hooks complete
[        ] [        ] exiting with code 0
[ +262 ms] [2/5] Building CXX object CMakeFiles/foo.dir/flutter/generated_plugin_registrant.cc.o
[  +34 ms] [3/5] Building CXX object CMakeFiles/foo.dir/my_application.cc.o
[  +25 ms] [4/5] Linking CXX executable intermediates_do_not_run/foo
[        ] [4/5] Install the project...
[   +3 ms] -- Install configuration: "Release"
[   +4 ms] -- Installing: /home/adam/projects/equalit.ie/sandbox/flutter/foo/build/linux/x64/release/bundle/foo
[        ] -- Set non-toolchain portion of runtime path of "/home/adam/projects/equalit.ie/sandbox/flutter/foo/build/linux/x64/release/bundle/foo" to "$ORIGIN/lib"
[        ] -- Installing: /home/adam/projects/equalit.ie/sandbox/flutter/foo/build/linux/x64/release/bundle/data/icudtl.dat
[   +1 ms] -- Installing: /home/adam/projects/equalit.ie/sandbox/flutter/foo/build/linux/x64/release/bundle/lib/libflutter_linux_gtk.so
[  +15 ms] -- Up-to-date: /home/adam/projects/equalit.ie/sandbox/flutter/foo/build/linux/x64/release/bundle/lib
[        ] -- Installing: /home/adam/projects/equalit.ie/sandbox/flutter/foo/build/linux/x64/release/bundle/data/flutter_assets
[        ] -- Installing: /home/adam/projects/equalit.ie/sandbox/flutter/foo/build/linux/x64/release/bundle/data/flutter_assets/fonts
[        ] -- Installing: /home/adam/projects/equalit.ie/sandbox/flutter/foo/build/linux/x64/release/bundle/data/flutter_assets/fonts/MaterialIcons-Regular.otf
[   +1 ms] -- Installing: /home/adam/projects/equalit.ie/sandbox/flutter/foo/build/linux/x64/release/bundle/data/flutter_assets/NOTICES.Z
[        ] -- Installing: /home/adam/projects/equalit.ie/sandbox/flutter/foo/build/linux/x64/release/bundle/data/flutter_assets/version.json
[        ] -- Installing: /home/adam/projects/equalit.ie/sandbox/flutter/foo/build/linux/x64/release/bundle/data/flutter_assets/FontManifest.json
[        ] -- Installing: /home/adam/projects/equalit.ie/sandbox/flutter/foo/build/linux/x64/release/bundle/data/flutter_assets/packages
[        ] -- Installing: /home/adam/projects/equalit.ie/sandbox/flutter/foo/build/linux/x64/release/bundle/data/flutter_assets/packages/cupertino_icons
[        ] -- Installing: /home/adam/projects/equalit.ie/sandbox/flutter/foo/build/linux/x64/release/bundle/data/flutter_assets/packages/cupertino_icons/assets
[        ] -- Installing: /home/adam/projects/equalit.ie/sandbox/flutter/foo/build/linux/x64/release/bundle/data/flutter_assets/packages/cupertino_icons/assets/CupertinoIcons.ttf
[        ] -- Installing: /home/adam/projects/equalit.ie/sandbox/flutter/foo/build/linux/x64/release/bundle/data/flutter_assets/shaders
[        ] -- Installing: /home/adam/projects/equalit.ie/sandbox/flutter/foo/build/linux/x64/release/bundle/data/flutter_assets/shaders/ink_sparkle.frag
[        ] -- Installing: /home/adam/projects/equalit.ie/sandbox/flutter/foo/build/linux/x64/release/bundle/data/flutter_assets/AssetManifest.bin
[        ] -- Installing: /home/adam/projects/equalit.ie/sandbox/flutter/foo/build/linux/x64/release/bundle/data/flutter_assets/AssetManifest.json
[        ] -- Installing: /home/adam/projects/equalit.ie/sandbox/flutter/foo/build/linux/x64/release/bundle/lib/libapp.so
[  +12 ms] Building Linux application... (completed in 1,488ms)
[   +3 ms] ✓ Built build/linux/x64/release/bundle/foo
[        ] "flutter linux" took 1,772ms.
[   +2 ms] Running 0 shutdown hooks
[        ] Shutdown hooks complete
[        ] exiting with code 0

Flutter Doctor output

Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.22.3, on Ubuntu 22.04.4 LTS 5.15.0-113-generic, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✗] 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
[!] Android Studio (not installed)
[✓] Connected device (2 available)
[✓] Network resources

! Doctor found issues in 2 categories.

Activity

  1. changed the title [-]--build-name is ignored on linux[/-] [+]`--build-name` is ignored on linux[/+] on Jul 24, 2024
  2. danagbemava-nc commented on Jul 25, 2024

    @danagbemava-nc
    Member

    Reproducible using the steps outlined above. This is the case with --build-number as well. Looking at the text from the flutter build <platform> --help command, it doesn't seem like linux has been taken into account as it lists the various options for the supported platforms but linux (web also) are not mentioned. Although, It could just be that it is out of date.

    Labeling for further insight.

        --build-number                                           An identifier used as an internal version number.
                                                                 Each build must have a unique identifier to differentiate it from
                                                                 previous builds.
                                                                 It is used to determine whether one build is more recent than another,
                                                                 with higher numbers indicating more recent build.
                                                                 On Android it is used as "versionCode".
                                                                 On Xcode builds it is used as "CFBundleVersion".
                                                                 On Windows it is used as the build suffix for the product and file
                                                                 versions.
        --build-name=<x.y.z>                                     A "x.y.z" string used as the version number shown to users.
                                                                 For each new version of your app, you will provide a version number to
                                                                 differentiate it from previous versions.
                                                                 On Android it is used as "versionName".
                                                                 On Xcode builds it is used as "CFBundleShortVersionString".
                                                                 On Windows it is used as the major, minor, and patch parts of the
                                                                 product and file versions.
    
    flutter doctor -v
    [!] Flutter (Channel master, 3.24.0-1.0.pre.230, on Ubuntu 24.04 LTS 6.8.0-38-generic, locale en_US.UTF-8)
        • Flutter version 3.24.0-1.0.pre.230 on channel master at /home/daniel/fvm/versions/master
        ! Warning: `dart` on your path resolves to /home/linuxbrew/.linuxbrew/Cellar/dart/3.2.2/libexec/bin/dart, which is not inside your current Flutter SDK checkout at /home/daniel/fvm/versions/master. Consider adding /home/daniel/fvm/versions/master/bin to the front of your path.
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision ed470fd101 (2 days ago), 2024-07-23 00:37:30 -0700
        • Engine revision 0d32c2d195
        • Dart version 3.6.0 (build [3.6.0-71.0.dev](http://3.6.0-71.0.dev/))
        • DevTools version 2.37.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.
    
    [!] Flutter (Channel stable, 3.22.3, on Ubuntu 24.04 LTS 6.8.0-38-generic, locale en_US.UTF-8)
        • Flutter version 3.22.3 on channel stable at /home/daniel/fvm/versions/stable
        ! Warning: `dart` on your path resolves to /home/linuxbrew/.linuxbrew/Cellar/dart/3.2.2/libexec/bin/dart, which is not inside your current Flutter SDK checkout at /home/daniel/fvm/versions/stable. Consider adding /home/daniel/fvm/versions/stable/bin to the front of your path.
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision b0850beeb2 (8 days ago), 2024-07-16 21:43:41 -0700
        • Engine revision 235db911ba
        • Dart version 3.4.4
        • DevTools version 2.34.3
        • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.
    
  3. added
    toolAffects the "flutter" command-line tool. See also t: labels.
    platform-linuxBuilding on or for Linux specifically
    a: buildBuilding flutter applications with the tool
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    team-toolOwned by Flutter Tool team
    and removed
    in triagePresently being triaged by the triage team
    on Jul 25, 2024
  4. added
    P2Important issues not at the top of the work list
    triaged-toolTriaged by Flutter Tool team
    on Aug 28, 2024
  5. tomarra commented on Mar 28, 2025

    @tomarra

    Can confirm this is still happening as of Flutter 3.29.2 on both a new project as well as my current project which I'm attempting to add Linux support for https://github.com/tomarra/toms_recipe_app/actions/runs/14118750396/job/39554850280 in which --build-number is an important flag for me to pass in.

  6. added
    fyi-toolFor the attention of Flutter Tool team
    team-linuxOwned by the Linux platform team
    and removed
    team-toolOwned by Flutter Tool team
    on Jul 11, 2025
  7. github-actions commented on Aug 25, 2026

    @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.

  8. locked as resolved and limited conversation to collaborators on Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: buildBuilding flutter applications with the toolfound in release: 3.22Found to occur in 3.22found in release: 3.24Found to occur in 3.24has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-linuxBuilding on or for Linux specificallyteam-linuxOwned by the Linux platform teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-linuxTriaged by the Linux platform team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions