Skip to content

DTD URI isn't printed if --machine is specified along with --print-dtd #176310

@gspencergoog

Description

@gspencergoog

Steps to reproduce

  1. Run a Flutter app with flutter run --print-dtd.
  2. Notice that it prints the DTD URI properly.
  3. Run the same app with flutter run --machine --print-dtd
  4. Notice that the DTD URI is not provided in the JSON output (or indeed anywhere).

Expected results

I would expect there to be a field in the JSON output that is "dtdUri" that contains the DTD URI.

For example I would have expected a message like this:

[{"event":"app.debugPort","params":{"appId":"6fa108c0-7e37-4766-9ebe-41185bd78163","port":45225,"wsUri":"ws://127.0.0.1:45225/BRJ3RQNK6dM=/ws","baseUri":"file:///tmp/fooSTLSBF/foo/", "dtdUri": "ws://127.0.0.1:42687/zCq8AhFOmLo="}}]

I also don't know why --print-dtd isn't the default. Perhaps it was deemed too confusing with the wsUri in there too?

Actual results

No DTD URI is emitted.

Code sample

You can use any flutter app (e.g. flutter create --empty foo works).

Screenshots or Video

No response

Logs

Logs

Without --machine:

> flutter run --print-dtd -d linux
Resolving dependencies... 
Downloading packages... 
  characters 1.4.0 (1.4.1 available)
  material_color_utilities 0.11.1 (0.13.0 available)
Got dependencies!
2 packages have newer versions incompatible with dependency constraints.
Try `flutter pub outdated` for more information.
Launching lib/main.dart on Linux in debug mode...
Building Linux application...                                           
✓ Built build/linux/x64/debug/bundle/foo
Gtk-Message: 13:52:15.664: Failed to load module "xapp-gtk3-module"
Gtk-Message: 13:52:15.664: Failed to load module "xapp-gtk3-module"
Syncing files to device Linux...                                    62ms

Flutter run key commands.
r Hot reload. 🔥🔥🔥
R Hot restart.
h List all available interactive commands.
d Detach (terminate "flutter run" but leave application running).
c Clear the screen
q Quit (terminate the application on the device).

A Dart VM Service on Linux is available at: http://127.0.0.1:45535/1-XWwedfPq4=/
The Dart Tooling Daemon is available at: ws://127.0.0.1:42687/zCq8AhFOmLo=
The Flutter DevTools debugger and profiler on Linux is available at:
http://127.0.0.1:45535/1-XWwedfPq4=/devtools/uri=ws://127.0.0.1:45535/1-XWwedfPq4=/ws
Lost connection to device.

With --machine:

> flutter run --print-dtd --machine -d linux
Resolving dependencies... 
Downloading packages... 
  characters 1.4.0 (1.4.1 available)
  material_color_utilities 0.11.1 (0.13.0 available)
Got dependencies!
2 packages have newer versions incompatible with dependency constraints.
Try `flutter pub outdated` for more information.
[{"event":"daemon.connected","params":{"version":"0.6.1","pid":1267719}}]
[{"event":"app.start","params":{"appId":"6fa108c0-7e37-4766-9ebe-41185bd78163","deviceId":"linux","directory":"/usr/local/google/home/user/code/gemini-cli-extension/foo","supportsRestart":true,"launchMode":"run","mode":"debug"}}]
Launching lib/main.dart on Linux in debug mode...
[{"event":"app.progress","params":{"appId":"6fa108c0-7e37-4766-9ebe-41185bd78163","id":"0","progressId":null,"message":"Building Linux application...","finished":false}}]
[{"event":"app.progress","params":{"appId":"6fa108c0-7e37-4766-9ebe-41185bd78163","id":"0","progressId":null,"finished":true}}]
✓ Built build/linux/x64/debug/bundle/foo
Gtk-Message: 13:53:06.702: Failed to load module "xapp-gtk3-module"
Gtk-Message: 13:53:06.702: Failed to load module "xapp-gtk3-module"
[{"event":"app.debugPort","params":{"appId":"6fa108c0-7e37-4766-9ebe-41185bd78163","port":45225,"wsUri":"ws://127.0.0.1:45225/BRJ3RQNK6dM=/ws","baseUri":"file:///tmp/fooSTLSBF/foo/"}}]
[{"event":"app.progress","params":{"appId":"6fa108c0-7e37-4766-9ebe-41185bd78163","id":"1","progressId":"devFS.update","message":"Syncing files to device Linux...","finished":false}}]
[{"event":"app.progress","params":{"appId":"6fa108c0-7e37-4766-9ebe-41185bd78163","id":"1","progressId":"devFS.update","finished":true}}]
[{"event":"app.started","params":{"appId":"6fa108c0-7e37-4766-9ebe-41185bd78163"}}]

Flutter Doctor output

Doctor output
[✓] Flutter (Channel main, 3.37.0-1.0.pre-345, on Debian GNU/Linux rodete 6.12.32-1rodete1-amd64, locale
    en_US.UTF-8) [836ms]
    • Flutter version 3.37.0-1.0.pre-345 on channel main at /usr/local/google/home/user/code/flutter
    • Upstream repository [email protected]:flutter/flutter.git
    • Framework revision 3fb9ae79f5 (6 hours ago), 2025-09-30 10:51:18 -0400
    • Engine revision 3fb9ae79f5
    • Dart version 3.10.0 (build 3.10.0-247.0.dev)
    • DevTools version 2.50.0
    • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop,
      enable-android, enable-ios, cli-animations, enable-native-assets, omit-legacy-version-file,
      enable-lldb-debugging

[!] Android toolchain - develop for Android devices (Android SDK version 35.0.0) [1,345ms]
    • Android SDK at /usr/local/google/home/user/Android/Sdk
    • Emulator version 35.2.10.0 (build_id 12414864) (CL:N/A)
    • Platform android-36, build-tools 35.0.0
    • ANDROID_HOME = /usr/local/google/home/user/Android/Sdk
    • Java binary at: /usr/bin/java
      This JDK was found in the system PATH.
      To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version OpenJDK Runtime Environment (build 21.0.8+9-Debian-1gl0)
    ! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses

[✓] Chrome - develop for the web [24ms]
    • Chrome at google-chrome

[✓] Linux toolchain - develop for Linux desktop [782ms]
    • Debian clang version 19.1.7 (3+build4)
    • cmake version 3.31.6
    • ninja version 1.12.1
    • pkg-config version 1.8.1
    • OpenGL core renderer: Quadro P1000/PCIe/SSE2 (X11)
    • OpenGL core version: 4.6.0 NVIDIA 550.163.01 (X11)
    • OpenGL core shading language version: 4.60 NVIDIA (X11)
    • OpenGL ES renderer: Quadro P1000/PCIe/SSE2 (X11)
    • OpenGL ES version: OpenGL ES 3.2 NVIDIA 550.163.01 (X11)
    • OpenGL ES shading language version: OpenGL ES GLSL ES 3.20 (X11)
    • GL_EXT_framebuffer_blit: yes (X11)
    • GL_EXT_texture_format_BGRA8888: yes (X11)

[✓] Connected device (2 available) [190ms]
    • Linux (desktop) • linux  • linux-x64      • Debian GNU/Linux rodete 6.12.32-1rodete1-amd64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 140.0.7339.207

[✓] Network resources [247ms]
    • All expected network resources are available.

! Doctor found issues in 1 category.

Metadata

Metadata

Assignees

No one assigned

    Labels

    found in release: 3.35Found to occur in 3.35found in release: 3.37Found to occur in 3.37has 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.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions