Repository: flutter
Issue: Flutter project - All files duplicated when created
Labels: tool,platform-mac,P2,team-tool,triaged-tool

Whenever I create a Flutter project either by using the Flutter CLI or Android Studio, a strange problems seem to occur. All files are duplicated and a ' 2' (space two) is put in the end of the file's name.

1. Run `flutter create bug`.
2. Look at the project structure

![Image](https://i.stack.imgur.com/BLPOp.png)

**Expected results:**
A project without all of theses duplicated files.

**Actual results:**
A project with all of theses duplicated files.

<details>
  <summary>Logs</summary>

```
[        ] /Users/matheuscirillo/Documents/Alura/flutter/flutter_app/android/app/src/main/res/mipmap-mdpi/ic_launcher 2.png: Resource and asset merger: ' ' is not a
valid file-based resource name character: File-based resource names must contain only lowercase a-z, 0-9, or underscore
[   +1 ms] /Users/matheuscirillo/Documents/Alura/flutter/flutter_app/android/app/src/main/res/mipmap-hdpi/ic_launcher 2.png: Resource and asset merger: ' ' is not a
valid file-based resource name character: File-based resource names must contain only lowercase a-z, 0-9, or underscore
[   +1 ms] /Users/matheuscirillo/Documents/Alura/flutter/flutter_app/android/app/src/main/res/drawable/launch_background 2.xml: Resource and asset merger: ' ' is not a
valid file-based resource name character: File-based resource names must contain only lowercase a-z, 0-9, or underscore
[        ] /Users/matheuscirillo/Documents/Alura/flutter/flutter_app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher 2.png: Resource and asset merger: ' ' is not a
valid file-based resource name character: File-based resource names must contain only lowercase a-z, 0-9, or underscore
[   +1 ms] /Users/matheuscirillo/Documents/Alura/flutter/flutter_app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher 2.png: Resource and asset merger: ' ' is not a
valid file-based resource name character: File-based resource names must contain only lowercase a-z, 0-9, or underscore
[        ] /Users/matheuscirillo/Documents/Alura/flutter/flutter_app/android/app/src/main/res/mipmap-xhdpi/ic_launcher 2.png: Resource and asset merger: ' ' is not a
valid file-based resource name character: File-based resource names must contain only lowercase a-z, 0-9, or underscore
[  +90 ms] FAILURE: Build failed with an exception.
[        ] * What went wrong:
[        ] Execution failed for task ':app:mergeDebugResources'.
[        ] > /Users/matheuscirillo/Documents/Alura/flutter/flutter_app/android/app/src/main/res/mipmap-mdpi/ic_launcher 2.png: Error: ' ' is not a valid file-based
resource name character: File-based resource names must contain only lowercase a-z, 0-9, or underscore
[        ]   /Users/matheuscirillo/Documents/Alura/flutter/flutter_app/android/app/src/main/res/mipmap-hdpi/ic_launcher 2.png: Error: ' ' is not a valid file-based
resource name character: File-based resource names must contain only lowercase a-z, 0-9, or underscore
[   +1 ms]   /Users/matheuscirillo/Documents/Alura/flutter/flutter_app/android/app/src/main/res/drawable/launch_background 2.xml: Error: ' ' is not a valid file-based
resource name character: File-based resource names must contain only lowercase a-z, 0-9, or underscore
[   +1 ms]   /Users/matheuscirillo/Documents/Alura/flutter/flutter_app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher 2.png: Error: ' ' is not a valid file-based
resource name character: File-based resource names must contain only lowercase a-z, 0-9, or underscore
[   +1 ms]   /Users/matheuscirillo/Documents/Alura/flutter/flutter_app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher 2.png: Error: ' ' is not a valid file-based
resource name character: File-based resource names must contain only lowercase a-z, 0-9, or underscore
[   +1 ms]   /Users/matheuscirillo/Documents/Alura/flutter/flutter_app/android/app/src/main/res/mipmap-xhdpi/ic_launcher 2.png: Error: ' ' is not a valid file-based
resource name character: File-based resource names must contain only lowercase a-z, 0-9, or underscore
```
</details>

The error `' ' is not a valid file-based` led me to believe that this is related to the ' 2' that goes in the end of the file's name. (see the Logs section)

## EDIT

`flutter doctor -v` command result:

```
[✓] Flutter (Channel stable, v1.12.13+hotfix.9, on Mac OS X 10.14.5 18F132, locale pt-BR)
    • Flutter version 1.12.13+hotfix.9 at /Users/matheuscirillo/Documents/flutter
    • Framework revision f139b11009 (5 weeks ago), 2020-03-30 13:57:30 -0700
    • Engine revision af51afceb8
    • Dart version 2.7.2

 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at /Users/matheuscirillo/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.3
    • ANDROID_HOME = /Users/matheuscirillo/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
    • All Android licenses accepted.

[✗] Xcode - develop for iOS and macOS
    ✗ Xcode installation is incomplete; a full installation is necessary for iOS development.
      Download at: https://developer.apple.com/xcode/download/
      Or install Xcode via the App Store.
      Once installed, run:
        sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
        sudo xcodebuild -runFirstLaunch
    ✗ CocoaPods not installed.
        CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
        Without CocoaPods, plugins will not work on iOS or macOS.
        For more info, see https://flutter.dev/platform-plugins
      To install:
        sudo gem install cocoapods

[✓] Android Studio (version 3.6)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 45.1.1
    • Dart plugin version 192.7761
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)

[!] VS Code (version 1.44.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    ✗ Flutter extension not installed; install from
      https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[!] Connected device
    ! No devices available

! Doctor found issues in 3 categories.
```