Skip to content

flutter assemble overrides -d flag #97505

Closed

Description

@timsneath

Steps to Reproduce

Run flutter assemble -h:

[C:\scratch\runner_app] flutter assemble --help
Assemble and build Flutter resources.

Global options:
-h, --help                  Print this usage information.
-v, --verbose               Noisy logging, including all shell commands executed.
                            If used with "--help", shows hidden options. If used with "flutter doctor", shows additional
                            diagnostic information. (Use "-vv" to force verbose logging in those cases.)
-d, --device-id             Target device id or name (prefixes allowed).
...

Usage: flutter assemble [arguments]
-h, --help                            Print this usage information.
-d, --define=<target=key=value>       Allows passing configuration to a target, as in "--define=target=key=value".
...

Note that -d is defined as meaning both --device-id and --define.

Activity

  1. danagbemava-nc commented on Jan 31, 2022

    @danagbemava-nc
    Member

    Reproducible on stable and master.

    flutter assemble -h
    Assemble and build Flutter resources.
    
    Global options:
    -h, --help                  Print this usage information.
    -v, --verbose               Noisy logging, including all shell commands executed.
                                If used with "--help", shows hidden options. If used with "flutter
                                doctor", shows additional diagnostic information. (Use "-vv" to force
                                verbose logging in those cases.)
    -d, --device-id             Target device id or name (prefixes allowed).
        --version               Reports the version of this tool.
        --suppress-analytics    Suppress analytics reporting when this command runs.
    
    Usage: flutter assemble [arguments]
    -h, --help                            Print this usage information.
    -d, --define=<target=key=value>       Allows passing configuration to a target, as in
                                          "--define=target=key=value".
        --performance-measurement-file    Output individual target performance to a JSON file.
    -i, --input                           Allows passing additional inputs with "--input=key=value".
                                          Unlike defines, additional inputs do not generate a new
                                          configuration; instead they are treated as dependencies of the
                                          targets that use them.
        --depfile                         A file path where a depfile will be written. This contains all
                                          build inputs and outputs in a Make-style syntax.
        --build-inputs                    A file path where a newline-separated file containing all inputs
                                          used will be written after a build. This file is not included as
                                          a build input or output. This file is not written if the build
                                          fails for any reason.
        --build-outputs                   A file path where a newline-separated file containing all
                                          outputs created will be written after a build. This file is not
                                          included as a build input or output. This file is not written if
                                          the build fails for any reason.
    -o, --output                          A directory where output files will be written. Must be either
                                          absolute or relative from the root of the current Flutter
                                          project.
        --dart-define=<foo=bar>           Additional key-value pairs that will be available as constants
                                          from the String.fromEnvironment, bool.fromEnvironment,
                                          int.fromEnvironment, and double.fromEnvironment constructors.
                                          Multiple defines can be passed by repeating "--dart-define"
                                          multiple times.
        --resource-pool-size              The maximum number of concurrent tasks the build system will
                                          run.
    
    Run "flutter help" to see global options.
    flutter doctor -v
    [✓] Flutter (Channel stable, 2.8.1, on macOS 11.6.2 20G314 darwin-arm, locale en-GB)
        • Flutter version 2.8.1 at /Users/nexus/dev/sdks/flutter
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 77d935af4d (7 weeks ago), 2021-12-16 08:37:33 -0800
        • Engine revision 890a5fca2e
        • Dart version 2.15.1
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
        • Android SDK at /Users/nexus/Library/Android/sdk
        • Platform android-31, build-tools 31.0.0
        • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 13.0)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • CocoaPods version 1.11.2
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 2020.3)
        • Android Studio at /Applications/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.10+0-b96-7249189)
    
    [☠] IntelliJ IDEA Community Edition (the doctor check crashed)
        ✗ Due to an error, the doctor check did not complete. If the error message below is not helpful, please let us know about this issue at https://github.com/flutter/flutter/issues.
        ✗ FormatException: Unexpected extension byte (at offset 5)
        • #0      _Utf8Decoder.convertSingle (dart:convert-patch/convert_patch.dart:1789:7)
          #1      Utf8Decoder.convert (dart:convert/utf.dart:318:42)
          #2      InputStream.readString (package:archive/src/util/input_stream.dart:207:30)
          #3      new ZipDirectory.read (package:archive/src/zip/zip_directory.dart:40:30)
          #4      ZipDecoder.decodeBuffer (package:archive/src/zip_decoder.dart:19:30)
          #5      ZipDecoder.decodeBytes (package:archive/src/zip_decoder.dart:14:12)
          #6      IntelliJPlugins._findPluginXml (package:flutter_tools/src/intellij/intellij.dart:130:44)
          #7      IntelliJPlugins._readPackageVersion (package:flutter_tools/src/intellij/intellij.dart:141:40)
          #8      IntelliJPlugins.validatePackage (package:flutter_tools/src/intellij/intellij.dart:63:35)
          #9      IntelliJValidator.validate (package:flutter_tools/src/intellij/intellij_validator.dart:103:15)
          #10     asyncGuard.<anonymous closure> (package:flutter_tools/src/base/async_guard.dart:111:32)
          #11     asyncGuard.<anonymous closure> (package:flutter_tools/src/base/async_guard.dart:109:18)
          #12     _rootRun (dart:async/zone.dart:1428:13)
          #13     _CustomZone.run (dart:async/zone.dart:1328:19)
          #14     _runZoned (dart:async/zone.dart:1863:10)
          #15     runZonedGuarded (dart:async/zone.dart:1851:12)
          #16     runZoned (dart:async/zone.dart:1782:12)
          #17     asyncGuard (package:flutter_tools/src/base/async_guard.dart:109:3)
          #18     Doctor.startValidatorTasks (package:flutter_tools/src/doctor.dart:197:9)
          #19     Doctor.diagnose (package:flutter_tools/src/doctor.dart:301:47)
          #20     DoctorCommand.runCommand (package:flutter_tools/src/commands/doctor.dart:53:47)
          #21     FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:1290:12)
          <asynchronous suspension>
          #22     FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1140:27)
          <asynchronous suspension>
          #23     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
          <asynchronous suspension>
          #24     CommandRunner.runCommand (package:args/command_runner.dart:209:13)
          <asynchronous suspension>
          #25     FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:288:9)
          <asynchronous suspension>
          #26     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
          <asynchronous suspension>
          #27     FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:236:5)
          <asynchronous suspension>
          #28     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:62:9)
          <asynchronous suspension>
          #29     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
          <asynchronous suspension>
          #30     main (package:flutter_tools/executable.dart:94:3)
          <asynchronous suspension>
    
    
    [✓] VS Code (version 1.63.2)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.32.0
    
    [✓] Connected device (3 available)
        • sdk gphone64 arm64 (mobile) • emulator-5554 • android-arm64  • Android 12 (API 31) (emulator)
        • macOS (desktop)             • macos         • darwin-arm64   • macOS 11.6.2 20G314 darwin-arm
        • Chrome (web)                • chrome        • web-javascript • Google Chrome 97.0.4692.99
    
    ! Doctor found issues in 1 category.
    [✓] Flutter (Channel master, 2.10.0-1.0.pre.337, on macOS 11.6.2 20G314 darwin-arm, locale en-GB)
        • Flutter version 2.10.0-1.0.pre.337 at /Users/nexus/dev/sdks/flutters
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 53771aba0c (15 hours ago), 2022-01-31 01:15:14 +0530
        • Engine revision fccb9b670d
        • Dart version 2.17.0 (build 2.17.0-67.0.dev)
        • DevTools version 2.10.0-dev.1
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
        • Android SDK at /Users/nexus/Library/Android/sdk
        • Platform android-31, build-tools 31.0.0
        • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 13.0)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • CocoaPods version 1.11.2
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 2020.3)
        • Android Studio at /Applications/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.10+0-b96-7249189)
    
    [✓] IntelliJ IDEA Community Edition (version 2021.3)
        • IntelliJ at /Applications/IntelliJ IDEA CE.app
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin version 213.5744.122
    
    [✓] VS Code (version 1.63.2)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.32.0
    
    [✓] Connected device (3 available)
        • sdk gphone64 arm64 (mobile) • emulator-5554 • android-arm64  • Android 12 (API 31) (emulator)
        • macOS (desktop)             • macos         • darwin-arm64   • macOS 11.6.2 20G314 darwin-arm
        • Chrome (web)                • chrome        • web-javascript • Google Chrome 97.0.4692.99
    
    [✓] HTTP Host Availability
        • All required HTTP hosts are available
    
    • No issues found!
  2. added
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    toolAffects the "flutter" command-line tool. See also t: labels.
    and removed
    in triagePresently being triaged by the triage team
    on Jan 31, 2022
  3. added
    P2Important issues not at the top of the work list
    on Mar 1, 2022
  4. christopherfujino commented on Mar 1, 2022

    @christopherfujino
    Contributor

    There are multiple issues here:

    • we should hide flutter assemble from non verbose help text, as it is not a normal user-facing sub-command
    • there is a collision between -d for device-id and define; ideally this would be enforced in package:args
    • flutter assemble should not show --device-id, so that option should probably not be global.
  5. added
    tool-still-validIssues that have been deemed still valid as part of the Flutter Tools issue cleanup initiative.
    on Jul 11, 2025
  6. self-assigned this
    on Jul 11, 2025
  7. matanlurey commented on Jul 25, 2025

    @matanlurey
    Contributor

    Changing it from a global (-d) is hard, but the rest of the steps are done.

  8. github-actions commented on Aug 11, 2025

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

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

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work listfound in release: 2.10Found to occur in 2.10found in release: 2.8Found to occur in 2.8has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionteam-toolOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.tool-still-validIssues that have been deemed still valid as part of the Flutter Tools issue cleanup initiative.triaged-toolTriaged by Flutter Tool team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions