Skip to content

flutter analyze crashes with FormatException when project path contains non-ASCII characters (Flutter 3.47) #191309

Closed

Description

@AlexanderVegazo26

Description

flutter analyze crashes with an unhandled FormatException: Unexpected end of input in the analysis server's LSP channel when the project is located under a path containing non-ASCII characters (e.g. a curly apostrophe ’ in Alexander’s MacBook Pro).

dart analyze on the same project works fine.

Steps to reproduce

  1. Create a directory with a non-ASCII character in its name, e.g. ~/Alexander’s/projects
  2. cd into it and run flutter create repro
  3. cd repro && flutter analyze

The same project copied to a pure-ASCII path analyzes without issues. Running via an ASCII symlink also fails, because the tool resolves the symlink back to the real (non-ASCII) path.

Expected result

flutter analyze completes normally regardless of path characters.

Actual result

The analysis server exits with code 255:

Unhandled exception:
FormatException: Unexpected end of input (at character 490)
...evenuoapp/"}],"capabilities":{"window":{"workDoneProgress":true}}
                                                                              ^
#0      _ChunkedJsonParser.fail (dart:convert-patch/convert_patch.dart:1466)
#1      _ChunkedJsonParser.close (dart:convert-patch/convert_patch.dart:496)
#6      LspByteStreamServerChannel._readMessage (package:analysis_server/src/lsp/channel/lsp_byte_stream_channel.dart:96)
...
analysis server exited with code 255

The truncated payload is the LSP initialize message whose rootUri contains the non-ASCII path. This looks like a Content-Length computed in characters rather than UTF-8 bytes somewhere in the flutter tool's LSP client, so the server reads fewer bytes than the actual message and JSON parsing hits end of input.

Environment

  • Flutter 3.47.0 stable (revision 4cf2416)
  • Dart 3.13.0
  • macOS 26.6.1 (arm64)

Regression note: this worked on Flutter 3.41.4 with the same project path.

Activity

  1. puneetkukreja98 commented on Aug 19, 2026

    @puneetkukreja98
    Contributor

    @AlexanderVegazo26 Thanks for reporting this issue, I was able to reproduce it on my both machines mac & windows.

    Confirming this as a regression. I downgraded to Flutter 3.41.4 to test, and flutter analyze runs without any issues there.

    Findings:

    Terminal logs macOS:

    puneetkukreja@Puneets-MacBook-Air-2 ~ % cd google
    puneetkukreja@Puneets-MacBook-Air-2 google % pwd
    /Users/puneetkukreja/google
    puneetkukreja@Puneets-MacBook-Air-2 google % mkdir "Puneet’s_repro"
    puneetkukreja@Puneets-MacBook-Air-2 google % ls
    issue_191167_app	Puneet’s_repro		splash_stable		vk_engine_churn_repro
    puneetkukreja@Puneets-MacBook-Air-2 google % cd "Puneet’s_repro"
    puneetkukreja@Puneets-MacBook-Air-2 Puneet’s_repro % flutter create repro_app
    Developer identity "Apple Development: 917000180280 (62HY893DS7)" selected for iOS code signing
    Creating project repro_app...
    Resolving dependencies in `repro_app`... 
    Downloading packages... 
    Got dependencies in `repro_app`.
    Wrote 131 files.
    
    All done!
    You can find general documentation for Flutter at: https://docs.flutter.dev/
    Detailed API documentation is available at: https://api.flutter.dev/
    If you prefer video documentation, consider: https://www.youtube.com/c/flutterdev
    
    In order to run your application, type:
    
      $ cd repro_app
      $ flutter run
    
    Your application code is in repro_app/lib/main.dart.
    
    puneetkukreja@Puneets-MacBook-Air-2 Puneet’s_repro % cd repro_app 
    puneetkukreja@Puneets-MacBook-Air-2 repro_app % flutter analyze
    Unhandled exception:
    FormatException: Unexpected end of input (at character 369)
    ...99s_repro/repro_app/"}],"capabilities":{"window":{"workDoneProgress":true}}
                                                                                  ^
    
    #0      _ChunkedJsonParser.fail (dart:convert-patch/convert_patch.dart:1466)
    #1      _ChunkedJsonParser.close (dart:convert-patch/convert_patch.dart:496)
    #2      _parseJson (dart:convert-patch/convert_patch.dart:36)
    #3      JsonDecoder.convert (dart:convert/json.dart:640)
    #4      JsonCodec.decode (dart:convert/json.dart:219)
    #5      jsonDecode (dart:convert/json.dart:160)
    #6      LspByteStreamServerChannel._readMessage (package:analysis_server/src/lsp/channel/lsp_byte_stream_channel.dart:96)
    #7      LspByteStreamServerChannel.listen.<anonymous closure> (package:analysis_server/src/lsp/channel/lsp_byte_stream_channel.dart:67)
    #8      _rootRunUnary (dart:async/zone_root.dart:48)
    #9      _CustomZone.runUnary (dart:async/zone.dart:816)
    #10     _CustomZone.runUnaryGuarded (dart:async/zone.dart:710)
    #11     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:381)
    #12     _DelayedData.perform (dart:async/stream_impl.dart:573)
    #13     _PendingEvents.handleNext (dart:async/stream_impl.dart:678)
    #14     _PendingEvents.schedule.<anonymous closure> (dart:async/stream_impl.dart:649)
    #15     _rootRun (dart:async/zone_root.dart:27)
    #16     _CustomZone.run (dart:async/zone.dart:810)
    #17     _CustomZone.runGuarded (dart:async/zone.dart:702)
    #18     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:743)
    #19     _rootRun (dart:async/zone_root.dart:35)
    #20     _CustomZone.run (dart:async/zone.dart:810)
    #21     _CustomZone.runGuarded (dart:async/zone.dart:702)
    #22     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:743)
    #23     _microtaskLoop (dart:async/schedule_microtask.dart:40)
    #24     _startMicrotaskLoop (dart:async/schedule_microtask.dart:49)
    #25     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:127)
    #26     _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:193)
    Analyzing repro_app...                                                  
    analysis server exited with code 255 and output:
    [stderr] #7      LspByteStreamServerChannel.listen.<anonymous closure> (package:analysis_server/src/lsp/channel/lsp_byte_stream_channel.dart:67)
    [stderr] #8      _rootRunUnary (dart:async/zone_root.dart:48)
    [stderr] #9      _CustomZone.runUnary (dart:async/zone.dart:816)
    [stderr] #10     _CustomZone.runUnaryGuarded (dart:async/zone.dart:710)
    [stderr] #11     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:381)
    [stderr] #12     _DelayedData.perform (dart:async/stream_impl.dart:573)
    [stderr] #13     _PendingEvents.handleNext (dart:async/stream_impl.dart:678)
    [stderr] #14     _PendingEvents.schedule.<anonymous closure> (dart:async/stream_impl.dart:649)
    [stderr] #15     _rootRun (dart:async/zone_root.dart:27)
    [stderr] #16     _CustomZone.run (dart:async/zone.dart:810)
    [stderr] #17     _CustomZone.runGuarded (dart:async/zone.dart:702)
    [stderr] #18     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:743)
    [stderr] #19     _rootRun (dart:async/zone_root.dart:35)
    [stderr] #20     _CustomZone.run (dart:async/zone.dart:810)
    [stderr] #21     _CustomZone.runGuarded (dart:async/zone.dart:702)
    [stderr] #22     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:743)
    [stderr] #23     _microtaskLoop (dart:async/schedule_microtask.dart:40)
    [stderr] #24     _startMicrotaskLoop (dart:async/schedule_microtask.dart:49)
    [stderr] #25     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:127)
    [stderr] #26     _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:193)
    puneetkukreja@Puneets-MacBook-Air-2 repro_app % dart analyze
    Analyzing repro_app...                 3.2s
    No issues found!
    puneetkukreja@Puneets-MacBook-Air-2 repro_app % 
    

    Flutter doctor -v:

    puneetkukreja@Puneets-MacBook-Air-2 google % flutter doctor -v
    [✓] Flutter (Channel stable, 3.47.0, on macOS 26.4.1 25E253 darwin-arm64, locale en-US) [766ms]
        • Flutter version 3.47.0 on channel stable at /Users/puneetkukreja/Developer/flutter
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 4cf2416426 (6 days ago), 2026-08-11 11:53:49 -0700
        • Engine revision 5f77625673
        • Dart version 3.13.0
        • DevTools version 2.60.0
        • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-native-assets, enable-record-use,
          enable-swift-package-manager, omit-legacy-version-file, enable-lldb-debugging, enable-uiscene-migration
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 37.0.0-rc1) [10.8s]
        • Android SDK at /Users/puneetkukreja/Library/Android/sdk
        • Emulator version 37.1.11.0 (build_id 15917651) (CL:N/A)
        • Platform android-37.1, build-tools 37.0.0-rc1
        • Java binary at: /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/bin/java
          This JDK is specified in your Flutter configuration.
          To change the current JDK, run: `flutter config --jdk-dir="path/to/jdk"`.
        • Java version Java(TM) SE Runtime Environment (build 17.0.12+8-LTS-286)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 26.6) [1,397ms]
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Build 17F113
        • CocoaPods version 1.16.2
    
    [✓] Chrome - develop for the web [7ms]
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Connected device (3 available) [7.8s]
        • moto g57 power (mobile) • ZN52278M76 • android-arm64  • Android 16 (API 36)
        • macOS (desktop)         • macos      • darwin-arm64   • macOS 26.4.1 25E253 darwin-arm64
        • Chrome (web)            • chrome     • web-javascript • Google Chrome 151.0.7922.138
        ! Error: Browsing on the local area network for Puneet’s iPhone. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac.
          The device must be opted into Developer Mode to connect wirelessly. (code -27)
    
    [✓] Network resources [929ms]
        • All expected network resources are available.
    
    • No issues found!
    
  2. puneetkukreja98 commented on Aug 19, 2026

    @puneetkukreja98
    Contributor

    Confirming this as a regression. I downgraded to Flutter 3.41.4 to test, and flutter analyze runs without any issues there.

    Terminal logs windows:

    PS C:\Developer\flutter> flutter doctor -v
    Checking Dart SDK version...
    Downloading Dart SDK from Flutter engine e4b8dca3f1b4ede4c30371002441c88c12187ed6...
    Expanding downloaded archive with PowerShell...
    Building flutter tool...
    Running pub upgrade...
    Resolving dependencies... (1.6s)
    Downloading packages...
    Got dependencies.
    Downloading package sky_engine...                                  622ms
    Downloading package flutter_gpu...                                 327ms
    Downloading flutter_patched_sdk tools...                         1,272ms
    Downloading flutter_patched_sdk_product tools...                   575ms
    Downloading windows-x64 tools...                                    4.7s
    Downloading windows-x64/font-subset tools...                     2,182ms
    [!] Flutter (Channel [user-branch], 3.41.4, on Microsoft Windows [Version 10.0.26200.9168], locale en-IN) [567ms]
        ! Flutter version 3.41.4 on channel [user-branch] at C:\Developer\flutter
          Currently on an unknown channel. Run `flutter channel` to switch to an official channel.
          If that doesn't fix the issue, reinstall Flutter by following instructions at https://flutter.dev/setup.
        ! Upstream repository unknown source is not a standard remote.
          Set environment variable "FLUTTER_GIT_URL" to unknown source to dismiss this error.
        • Framework revision ff37bef603 (6 months ago), 2026-03-03 16:03:22 -0800
        • Engine revision e4b8dca3f1
        • Dart version 3.11.1
        • DevTools version 2.54.1
        • 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-windowing, enable-lldb-debugging,
          enable-uiscene-migration
        • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform
          update checks and upgrades.
    
    [√] Windows Version (Windows 11 or higher, 25H2, 2009) [2.7s]
    
    [√] Android toolchain - develop for Android devices (Android SDK version 37.0.0) [4.6s]
        • Android SDK at C:\Users\Puneet\AppData\Local\Android\sdk
        • Emulator version 36.6.11.0 (build_id 15507667) (CL:N/A)
        • Platform android-37.1, build-tools 37.0.0
        • Java binary at: C:\Program Files\Android\Android Studio1\jbr\bin\java
          This is the JDK bundled with the latest Android Studio installation on this machine.
          To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
        • Java version OpenJDK Runtime Environment (build 21.0.10+-14961533-b1163.108)
        • All Android licenses accepted.
    
    [√] Chrome - develop for the web [207ms]
        • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
    
    [√] Visual Studio - develop Windows apps (Visual Studio Community 2026 18.3.2) [204ms]
        • Visual Studio at C:\Program Files\Microsoft Visual Studio\18\Community
        • Visual Studio Community 2026 version 18.3.11520.95
        • Windows 10 SDK version 10.0.26100.0
    
    [√] Connected device (3 available) [422ms]
        • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.26200.9168]
        • Chrome (web)      • chrome  • web-javascript • Google Chrome 151.0.7922.138
        • Edge (web)        • edge    • web-javascript • Microsoft Edge 151.0.4129.93
    
    [√] Network resources [1,250ms]
        • All expected network resources are available.
    
    ! Doctor found issues in 1 category.
    PS C:\Developer\flutter> cd ..
    PS C:\Developer> cd ..
    PS C:\> mkdir "C:\test_’_dir"
    
    
        Directory: C:\
    
    
    Mode                 LastWriteTime         Length Name
    ----                 -------------         ------ ----
    d-----        19-08-2026     07:36                test_’_dir
    
    
    PS C:\> cd "C:\test_’_dir"
    PS C:\test_’_dir> flutter create repro_app
    Creating project repro_app...
    Resolving dependencies in `repro_app`...
    Downloading packages...
    Got dependencies in `repro_app`.
    Wrote 131 files.
    
    All done!
    You can find general documentation for Flutter at: https://docs.flutter.dev/
    Detailed API documentation is available at: https://api.flutter.dev/
    If you prefer video documentation, consider: https://www.youtube.com/c/flutterdev
    
    In order to run your application, type:
    
      $ cd repro_app
      $ flutter run
    
    Your application code is in repro_app\lib\main.dart.
    
    PS C:\test_’_dir> cd .\repro_app\
    PS C:\test_’_dir\repro_app> flutter analyze
    Analyzing repro_app...
    No issues found! (ran in 60.1s)
    PS C:\test_’_dir\repro_app>
    
  3. added
    c: regressionIt was better in the past than it is now
    toolAffects the "flutter" command-line tool. See also t: labels.
    team-toolOwned by Flutter Tool team
    and removed
    in triagePresently being triaged by the triage team
    on Aug 19, 2026
  4. github-actions commented on Sep 3, 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.

  5. locked as resolved and limited conversation to collaborators on Sep 3, 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

    c: regressionIt was better in the past than it is nowfound in release: 3.47Found to occur in 3.47team-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