Repository: flutter
Issue: [gradle] Flutter generates files under `android/app/build`
Labels: platform-android,tool,t: gradle,P2,team-android,triaged-android

## Steps to Reproduce

1. Create a new Flutter project that includes Android support
2. Check out android/build.gradle

My earlier projects had the following fragment:

```
rootProject.buildDir = '../build'
subprojects {
  project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
  project.evaluationDependsOn(':app')
}
```

Currently, a slightly simplified (?) fragment is created:

```
rootProject.buildDir = '../build'
subprojects {
  project.buildDir = "${rootProject.buildDir}/${project.name}"
  project.evaluationDependsOn(':app')
}
```

**Actual results:**

With the current Gradle code, building behaves slightly differently. Part of the generated intermediate files will be placed into `android/app/build` instead of `build/app`. The building process works all right but because those files are no longer under `build`, a `flutter clean` command will not remove them. Or, Android Studio's _Export to Zip File_ that archives all the important source files necessary to backup a project will also package these intermediate files unnecessarily.

<details>
<summary>Code sample</summary>

<!--
      Please create a minimal reproducible sample that shows the problem
      and attach it below between the lines with the backticks.

      To create it you can use `flutter create bug` command and update the `main.dart` file.

      Alternatively, you can use https://dartpad.dev/
      which is capable of creating and running small Flutter apps.

      Without this we will unlikely be able to progress on the issue, and because of that
      we regretfully will have to close it.
-->

```dart
```

</details>

<details>
  <summary>Doc</summary>

<!-- Finally, paste the output of running `flutter doctor -v` here. -->

```
[√] Flutter (Channel stable, 2.5.3, on Microsoft Windows [Version 10.0.19043.1348], locale en-US)
    • Flutter version 2.5.3 at E:\Android\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 18116933e7 (5 weeks ago), 2021-10-15 10:46:35 -0700
    • Engine revision d3ea636dc5
    • Dart version 2.14.4

[!] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at E:/Android/Sdk
    X cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    X Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.

[X] Chrome - develop for the web (Cannot find Chrome executable at .\Google\Chrome\Application\chrome.exe)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.11.5)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
    • Visual Studio Community 2019 version 16.11.31729.503
    • 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)

[√] Connected device (3 available)
    • sdk gphone x86 64 arm64 (mobile) • emulator-5554 • android-x64    • Android 11 (API 30) (emulator)
    • Windows (desktop)                • windows       • windows-x64    • Microsoft Windows [Version 10.0.19043.1348]
    • Edge (web)                       • edge          • web-javascript • Microsoft Edge 95.0.1020.53

! Doctor found issues in 2 categories.
Process finished with exit code 0
```

</details>


<!--
      Consider also attaching screenshots and/or videos to better
      illustrate the issue.

      You can upload them directly on GitHub.
      Beware that video file size is limited to 10MB.
-->