Repository: flutter
Issue: [flutter_tools] [build android on windows] building with --dart-define-from-file fails when json value contains "&" character
Labels: platform-android,tool,a: build,has reproducible steps,P2,found in release: 3.7,found in release: 3.9,team-android,triaged-android

# Use Case

When :
- building/running **Android** application on **Windows computer**
- json file used by `--dart-define-from-file` contains value `&`

Then : flutter_tools give datas to Gradle params and fails

Observation : As soon as i remove the `&` section from value, it works again

# Example

File `env-dev.json`
```
{ "authentification-url" : "https://auth.domain.com/signin?token=xxx&redirect=doesnt-work-anymore" }
```

Build command
```
$ flutter build apk --dart-define-from-file=env-dev.json
```

Result

```
Launching lib\main.dart on sdk gphone64 x86 64 in debug mode...
main.dart:1
Welcome to Gradle 7.4.
To run a build, run gradlew <task> ...
To see a list of available tasks, run gradlew tasks
To see more detail about a task, run gradlew help --task <task>
To see a list of command-line options, run gradlew --help
For more detail on using Gradle, see https://docs.gradle.org/7.4/userguide/command_line_interface.html
For troubleshooting, visit https://help.gradle.org
'redirect' is not recognized as an internal or external command,
operable program or batch file.
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
```

![image](https://user-images.githubusercontent.com/10436754/222491507-e29e8569-2969-41ad-bd9f-8d3fc7246f0c.png)

# Doctor

```
$ flutter doctor -v
[!] Flutter (Channel stable, 3.7.3, on Microsoft Windows [Version 10.0.19044.2486], locale fr-FR)
    • Flutter version 3.7.3 on channel stable at C:\Users\(me)\fvm\default
    ! Warning: `flutter` on your path resolves to C:\Users\(me)\fvm\versions\3.7.3\bin\flutter, which is not inside your current Flutter SDK checkout at C:\Users\(me)\fvm\default. Consider adding      
      C:\Users\(me)\fvm\default\bin to the front of your path.
    ! Warning: `dart` on your path resolves to C:\tools\dart-sdk\bin\dart.exe, which is not inside your current Flutter SDK checkout at C:\Users\(me)\fvm\default. Consider adding
      C:\Users\(me)\fvm\default\bin to the front of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 9944297138 (3 weeks ago), 2023-02-08 15:46:04 -0800
    • Engine revision 248290d6d5
    • Dart version 2.19.2
    • DevTools version 2.20.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.

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0-rc1)
    • Android SDK at C:\Users\(me)\AppData\Local\Android\sdk
    • Platform android-33, build-tools 34.0.0-rc1
    • Java binary at: C:\Program Files\Android\Android Studio1\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)   
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.0.4)       
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community      
    • Visual Studio Community 2022 version 17.0.32014.148
    • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2020.3)
    • Android Studio at C:\Program Files\Android\Android Studio
    • 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)        

[√] Android Studio (version 2021.3)
    • Android Studio at C:\Program Files\Android\Android Studio1
    • 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.13+0-b1751.21-8125866)   

[√] VS Code (version 1.76.0)
    • VS Code at 
    • Flutter extension version 3.60.0

[√] Connected device (4 available)
    • sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64    • Android 12 (API 31) (emulator)
    • Windows (desktop)            • windows       • windows-x64    • Microsoft Windows [Version 10.0.19044.2486]
    • Chrome (web)                 • chrome        • web-javascript • Google Chrome 110.0.5481.178
    • Edge (web)                   • edge          • web-javascript • Microsoft Edge 110.0.1587.57

[√] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 1 category.
```