Repository: flutter
Issue: Flutter build bundle does not work with symlinks on Windows
Labels: platform-android,tool,platform-windows,a: build,has reproducible steps,P2,found in release: 3.7,found in release: 3.9,team-android,triaged-android

## Steps to Reproduce

<!-- Please tell us exactly how to reproduce the problem you are running into. -->

1. Create (or use) a Flutter application with these attributes:
  - Has an asset in the pubspec specified as a directory.
  - The asset in the specified directory is a symlink to a file elsewhere.
2. On Windows, run *flutter build bundle*.

Result:
 The bundle will fail to build, *Target copy_flutter_bundle failed: FileSystemException: Cannot copy file* ... *(OS Error: The system cannot find the file specified.*
 Note that the same error will occur with *flutter run* or similar.
 The error **does not** occur with *flutter test*.

Example:
 I have created https://github.com/matthewblain/flutter_test_symlink_asset_10nov2020 which reproduces this error. If you look at the commit history (currently at 6 commits), you can see the steps where the tool goes from working to (at the final step) broken.

Important note:
 To have symlinks on Windows, you must enable them in the Group Policy Editor. When using a Git repository, ensure that the Windows policy is set and the Git core.symlinks configuration is true.


## Logs

<!--
      Include the full logs of the commands you are running between the lines
      with the backticks below. If you are running any "flutter" commands,
      please include the output of running them with "--verbose"; for example,
      the output of running "flutter --verbose create foo".
-->

Here is the output of *flutter build bundle*. I have attached the verbose version as a text file.
[buildbundlefailure.txt](https://github.com/flutter/flutter/files/5522064/buildbundlefailure.txt)
```
Font subetting is not supported in debug mode. The --tree-shake-icons flag will be ignored.
Target copy_flutter_bundle failed: FileSystemException: Cannot copy file to
'build\flutter_assets\assets/page_title.txt', path =
'C:\Users\mblain\src\flutter_test_symlink_asset_10nov2020\test_symlink_asset_10nov2020\assets\page_title.txt' (OS Error:
The system cannot find the file specified.
, errno = 2)
Failed to build bundle.
```

<!-- If possible, paste the output of running `flutter doctor -v` here. -->

```
[√] Flutter (Channel stable, 1.22.3, on Microsoft Windows [Version 10.0.18362.1139], locale en-US)
    • Flutter version 1.22.3 at C:\Users\mblain\src\flutter
    • Framework revision 8874f21e79 (12 days ago), 2020-10-29 14:14:35 -0700
    • Engine revision a1440ca392
    • Dart version 2.10.3


[!] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at C:\Users\mblain\AppData\Local\Android\sdk
    • Platform android-29, build-tools 29.0.2
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
    ! Some Android licenses not accepted.  To resolve this, run: flutter doctor --android-licenses

[!] Android Studio (version 4.1.0)
    • Android Studio at C:\Program Files\Android\Android Studio
    X Flutter plugin not installed; this adds Flutter specific functionality.
    X Dart plugin not installed; this adds Dart specific functionality.
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[!] Connected device
    ! No devices available
```