Skip to content

flutter run fails on Android on Windows when installed in a path with non-ascii symbol #149194

@eseidel

Description

@eseidel

I suspect this is an underlying gradle issue rather than Flutter, but I failed to find a meta bug for this issue for flutter_tools so filing one.

The root cause is that spaces an (in this case) non-ascii chars are almost always broken in tools (especially on windows) if they aren't covered in e2e testing, not due to the fault of the devs, rather that the fundamental building blocks of path handling are just broken on all systems, and so it's really hard to get all path handling correct.

In this case, non-ascii characters seem broken for at least android/gradle on windows, but possibly also other flutter commands.

To repro:

I tested locally by taking a stock flutter (not shorebird) copying it (to flutter2) and then renaming flutter2 to test_flutter木 (via explorer) and I also get failures from gradle when trying to run flutter out of test_flutter木

Even powershell seems confused by the 木.

This is the log from running a test within powershell within visual studio code:

PS C:\Users\micro> .\test_flutter?\bin\flutter create foo
Creating project foo...
Resolving dependencies in `foo`...
Downloading packages...
Got dependencies in `foo`.
Wrote 129 files.
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 foo
  $ flutter run

Your application code is in foo\lib\main.dart.

PS C:\Users\micro> cd .\foo\
PS C:\Users\micro\foo> ..\test_flutter?\bin\flutter run
Launching lib\main.dart on sdk gphone x86 64 in debug mode...

FAILURE: Build failed with an exception.

* Where:
Settings file 'C:\Users\micro\foo\android\settings.gradle' line: 20

* What went wrong:
Error resolving plugin [id: 'dev.flutter.flutter-plugin-loader', version: '1.0.0']
> Included build 'C:\Users\micro\test_flutter�?�\packages\flutter_tools\gradle' does not exist.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 13s
Running Gradle task 'assembleDebug'...                             15.1s
Error: Gradle task assembleDebug failed with exit code 1

shorebirdtech/shorebird#2140 is where this came in for Shorebird. https://github.com/shorebirdtech/shorebird/pull/2159/files is where we added a non-ascii char to our e2e tests for Shorebird, which passed everywhere but windows.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listc: crashStack traces logged to the consolefound in release: 3.22Found to occur in 3.22found in release: 3.23Found to occur in 3.23has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-androidAndroid applications specificallyplatform-windowsBuilding on or for Windows specificallyteam-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