Repository: flutter
Issue: got error(Execution failed for task ':app:compileFlutterBuildDebug'.) when run with multiple emulators
Labels: platform-android,tool,t: gradle,P2,team-android,triaged-android

## Steps to Reproduce

1. create following emulators using Android Studio
    a. Phone_V_2.7-QVGA-slider_api-23_240x320_ldpi Android 7.0 (API 24)
    b. Phone_V_3.2-QVGA-_ADP2_api-24_320x480_mdpi Android 6.0 (API 23)
    c. Phone_V_3.7-WVGA-_NexusOne_api-25_480x800_hdpi Android 7.1.1 (API 25)
    
2. create project 'test' using powershell 7.3, then cd into test folder  
    flutter create test
    cd test
    
3. start emulators using powershell 7.3   
    a. emulator -avd Phone_V_2.7-QVGA-slider_api-23_240x320_ldpi -netdelay none -netspeed full &
    b. emulator -avd Phone_V_3.2-QVGA-_ADP2_api-24_320x480_mdpi -netdelay none -netspeed full &
    c. emulator -avd Phone_V_3.7-WVGA-_NexusOne_api-25_480x800_hdpi -netdelay none -netspeed full &
    
4. check devices work fine with following command: flutter devices

```

PS D:\Projects\yongxin\bak\test> flutter devices
3 connected devices:

Android SDK built for x86 (mobile) • emulator-5554 • android-x86 • Android 7.0 (API 24) (emulator)
Android SDK built for x86 (mobile) • emulator-5556 • android-x86 • Android 6.0 (API 23) (emulator)
Android SDK built for x86 (mobile) • emulator-5558 • android-x86 • Android 7.1.1 (API 25) (emulator)

```
    
    
5. run on all devices with following command, then got error
    flutter run -d all

## Expected results

build project and work fine on each emulators

## Actual results

<details>

<summary>PS D:\Projects\yongxin\bak\test> flutter run -d all</summary>

```

PS D:\Projects\yongxin\bak\test> flutter run -d all

Using hardware rendering with device Android SDK built for x86. If you notice graphics artifacts, consider enabling software rendering with
"--enable-software-rendering".
Using hardware rendering with device Android SDK built for x86. If you notice graphics artifacts, consider enabling software rendering with
"--enable-software-rendering".
Using hardware rendering with device Android SDK built for x86. If you notice graphics artifacts, consider enabling software rendering with
"--enable-software-rendering".
Launching lib\main.dart on Android SDK built for x86 in debug mode...
Launching lib\main.dart on Android SDK built for x86 in debug mode...
Launching lib\main.dart on Android SDK built for x86 in debug mode...




FAILURE: Build failed with an exception.

* Where:
Script 'D:\ide\flutter\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1159

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'D:\ide\flutter\flutter\bin\flutter.bat'' finished with non-zero exit value 1

* 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 1m 44s

FAILURE: Build failed with an exception.

* Where:
Script 'D:\ide\flutter\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1159

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'D:\ide\flutter\flutter\bin\flutter.bat'' finished with non-zero exit value 1

* 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 1m 45s

FAILURE: Build failed with an exception.

* Where:
Script 'D:\ide\flutter\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1159

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'D:\ide\flutter\flutter\bin\flutter.bat'' finished with non-zero exit value 1

* 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 1m 45s
Running Gradle task 'assembleDebug'...                            107.6s
Exception: Gradle task assembleDebug failed with exit code 1
PS D:\Projects\yongxin\bak\test>

```

</details>

<details>
<summary>flutter doctor -v</summary>

```


[√] Flutter (Channel stable, 3.3.10, on Microsoft Windows [版本 10.0.19045.2486], locale zh-TW)
    • Flutter version 3.3.10 on channel stable at D:\ide\flutter\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 135454af32 (5 weeks ago), 2022-12-15 07:36:55 -0800
    • Engine revision 3316dd8728
    • Dart version 2.18.6
    • DevTools version 2.15.0

Checking Android licenses is taking an unexpectedly long time...[√] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
    • Android SDK at D:\ide\android\sdk
    • Platform android-33, build-tools 33.0.1
    • ANDROID_HOME = D:\ide\android\sdk
    • Java binary at: D:\ide\android\android-studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)
    • All Android licenses accepted.

[√] Android Studio (version 2022.1)
    • Android Studio at D:\ide\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.15+0-b2043.56-8887301)

[√] Connected device (3 available)
    • Android SDK built for x86 (mobile) • emulator-5554 • android-x86 • Android 7.0 (API 24) (emulator)
    • Android SDK built for x86 (mobile) • emulator-5556 • android-x86 • Android 6.0 (API 23) (emulator)
    • Android SDK built for x86 (mobile) • emulator-5558 • android-x86 • Android 7.1.1 (API 25) (emulator)

[√] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!


```

</details>