Repository: flutter
Issue: [Impeller] App stuck on black screen on launch on Android emulator API 30/33.
Labels: c: regression,e: device-specific,platform-android,engine,P2,e: impeller,team-engine,triaged-engine

### Steps to reproduce

1. Update Android Studio
2. flutter channel master
3. flutter upgrade
4. Create new app (just a new flutter app)
5. Run Android Emulator API 33
6. Run newly created app

### Expected results

Show default Flutter counter app

### Actual results

Black Screen of ruining my business

### Code sample

<details open><summary>Code sample</summary>

```dart
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        // This is the theme of your application.
        //
        // TRY THIS: Try running your application with "flutter run". You'll see
        // the application has a purple toolbar. Then, without quitting the app,
        // try changing the seedColor in the colorScheme below to Colors.green
        // and then invoke "hot reload" (save your changes or press the "hot
        // reload" button in a Flutter-supported IDE, or press "r" if you used
        // the command line to start the app).
        //
        // Notice that the counter didn't reset back to zero; the application
        // state is not lost during the reload. To reset the state, use hot
        // restart instead.
        //
        // This works for code too, not just values: Most code changes can be
        // tested with just a hot reload.
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  // This widget is the home page of your application. It is stateful, meaning
  // that it has a State object (defined below) that contains fields that affect
  // how it looks.

  // This class is the configuration for the state. It holds the values (in this
  // case the title) provided by the parent (in this case the App widget) and
  // used by the build method of the State. Fields in a Widget subclass are
  // always marked "final".

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  void _incrementCounter() {
    setState(() {
      // This call to setState tells the Flutter framework that something has
      // changed in this State, which causes it to rerun the build method below
      // so that the display can reflect the updated values. If we changed
      // _counter without calling setState(), then the build method would not be
      // called again, and so nothing would appear to happen.
      _counter++;
    });
  }

  @override
  Widget build(BuildContext context) {
    // This method is rerun every time setState is called, for instance as done
    // by the _incrementCounter method above.
    //
    // The Flutter framework has been optimized to make rerunning build methods
    // fast, so that you can just rebuild anything that needs updating rather
    // than having to individually change instances of widgets.
    return Scaffold(
      appBar: AppBar(
        // TRY THIS: Try changing the color here to a specific color (to
        // Colors.amber, perhaps?) and trigger a hot reload to see the AppBar
        // change color while the other colors stay the same.
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        // Here we take the value from the MyHomePage object that was created by
        // the App.build method, and use it to set our appbar title.
        title: Text(widget.title),
      ),
      body: Center(
        // Center is a layout widget. It takes a single child and positions it
        // in the middle of the parent.
        child: Column(
          // Column is also a layout widget. It takes a list of children and
          // arranges them vertically. By default, it sizes itself to fit its
          // children horizontally, and tries to be as tall as its parent.
          //
          // Column has various properties to control how it sizes itself and
          // how it positions its children. Here we use mainAxisAlignment to
          // center the children vertically; the main axis here is the vertical
          // axis because Columns are vertical (the cross axis would be
          // horizontal).
          //
          // TRY THIS: Invoke "debug painting" (choose the "Toggle Debug Paint"
          // action in the IDE, or press "p" in the console), to see the
          // wireframe for each widget.
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            const Text(
              'You have pushed the button this many times:',
            ),
            Text(
              '$_counter',
              style: Theme.of(context).textTheme.headlineMedium,
            ),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: const Icon(Icons.add),
      ), // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}

```

</details>


### Screenshots or Video

<details open>
<summary>Screenshots / Video demonstration</summary>

[Upload media here]

</details>


### Logs

<details open><summary>Logs</summary>

```console
Launching lib/main.dart on sdk gphone64 x86 64 in debug mode...
Running Gradle task 'assembleDebug'...
Warning: SDK processing. This version only understands SDK XML versions up to 3 but an SDK XML file of version 4 was encountered. This can happen if you use versions of Android Studio and the command-line tools that were released at different times.
Checking the license for package Android SDK Build-Tools 33.0.1 in /home/gandalf/Android/Sdk/licenses
License for package Android SDK Build-Tools 33.0.1 accepted.
Preparing "Install Android SDK Build-Tools 33.0.1 v.33.0.1".
"Install Android SDK Build-Tools 33.0.1 v.33.0.1" ready.
Installing Android SDK Build-Tools 33.0.1 in /home/gandalf/Android/Sdk/build-tools/33.0.1
"Install Android SDK Build-Tools 33.0.1 v.33.0.1" complete.
"Install Android SDK Build-Tools 33.0.1 v.33.0.1" finished.
✓ Built build/app/outputs/flutter-apk/app-debug.apk
Installing build/app/outputs/flutter-apk/app-debug.apk...
I/flutter ( 7132): [IMPORTANT:flutter/shell/platform/android/android_context_vk_impeller.cc(60)] Using the Impeller rendering backend (Vulkan).
E/flutter ( 7132): [ERROR:flutter/impeller/renderer/backend/vulkan/android/ahb_texture_source_vk.cc(133)] Break on 'ImpellerValidationBreak' to inspect point of failure: Could not allocate device memory for external image : ErrorOutOfDeviceMemory
E/flutter ( 7132): [ERROR:flutter/impeller/renderer/backend/vulkan/swapchain/ahb/ahb_texture_pool_vk.cc(69)] Break on 'ImpellerValidationBreak' to inspect point of failure: Could not create hardware buffer texture source for swapchain image of size: (1080, 2337)
E/flutter ( 7132): [ERROR:flutter/impeller/renderer/backend/vulkan/android/ahb_texture_source_vk.cc(133)] Break on 'ImpellerValidationBreak' to inspect point of failure: Could not allocate device memory for external image : ErrorOutOfDeviceMemory
E/flutter ( 7132): [ERROR:flutter/impeller/renderer/backend/vulkan/swapchain/ahb/ahb_texture_pool_vk.cc(69)] Break on 'ImpellerValidationBreak' to inspect point of failure: Could not create hardware buffer texture source for swapchain image of size: (1080, 2337)
E/flutter ( 7132): [ERROR:flutter/impeller/renderer/backend/vulkan/android/ahb_texture_source_vk.cc(133)] Break on 'ImpellerValidationBreak' to inspect point of failure: Could not allocate device memory for external image : ErrorOutOfDeviceMemory
E/flutter ( 7132): [ERROR:flutter/impeller/renderer/backend/vulkan/swapchain/ahb/ahb_texture_pool_vk.cc(69)] Break on 'ImpellerValidationBreak' to inspect point of failure: Could not create hardware buffer texture source for swapchain image of size: (1080, 2337)
E/flutter ( 7132): [ERROR:flutter/impeller/renderer/backend/vulkan/android/ahb_texture_source_vk.cc(133)] Break on 'ImpellerValidationBreak' to inspect point of failure: Could not allocate device memory for external image : ErrorOutOfDeviceMemory
E/flutter ( 7132): [ERROR:flutter/impeller/renderer/backend/vulkan/swapchain/ahb/ahb_texture_pool_vk.cc(69)] Break on 'ImpellerValidationBreak' to inspect point of failure: Could not create hardware buffer texture source for swapchain image of size: (1080, 2337)
Debug service listening on ws://127.0.0.1:45215/5jb0aIHUbNQ=/ws
Syncing files to device sdk gphone64 x86 64...
I/silia.aaflutter( 7132): Compiler allocated 4533KB to compile void android.view.ViewRootImpl.performTraversals()
E/flutter ( 7132): [ERROR:flutter/impeller/renderer/backend/vulkan/swapchain/ahb/ahb_swapchain_impl_vk.cc(111)] Break on 'ImpellerValidationBreak' to inspect point of failure: Could not create AHB texture source.
E/flutter ( 7132): [ERROR:flutter/shell/gpu/gpu_surface_vulkan_impeller.cc(58)] No surface available.
E/flutter ( 7132): [ERROR:flutter/impeller/renderer/backend/vulkan/swapchain/ahb/ahb_swapchain_impl_vk.cc(111)] Break on 'ImpellerValidationBreak' to inspect point of failure: Could not create AHB texture source.
E/flutter ( 7132): [ERROR:flutter/shell/gpu/gpu_surface_vulkan_impeller.cc(58)] No surface available.
W/Parcel  ( 7132): Expecting binder but got null!
E/flutter ( 7132): [ERROR:flutter/impeller/renderer/backend/vulkan/swapchain/ahb/ahb_swapchain_impl_vk.cc(111)] Break on 'ImpellerValidationBreak' to inspect point of failure: Could not create AHB texture source.
E/flutter ( 7132): [ERROR:flutter/shell/gpu/gpu_surface_vulkan_impeller.cc(58)] No surface available.
D/ProfileInstaller( 7132): Installing profile for br.com.xxxxxxx.aaflutter
```

</details>


### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
[✓] Flutter (Channel master, 3.26.0-1.0.pre.280, on Linux Mint 21.3 6.8.0-45-generic, locale en_US.UTF-8)
    • Flutter version 3.26.0-1.0.pre.280 on channel master at /home/gandalf/development/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision e6c955416d (37 minutes ago), 2024-09-30 20:20:08 -0400
    • Engine revision bfb6dddb2b
    • Dart version 3.6.0 (build 3.6.0-302.0.dev)
    • DevTools version 2.40.0-dev.2

[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
    • Android SDK at /home/gandalf/Android/Sdk
    • Platform android-35, build-tools 35.0.0
    • ANDROID_HOME = /home/gandalf/Android/Sdk
    • Java binary at: /home/gandalf/development/android-studio/jbr/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314)
    • All Android licenses accepted.

[✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[✓] Linux toolchain - develop for Linux desktop
    • Ubuntu clang version 14.0.0-1ubuntu1.1
    • cmake version 3.22.1
    • ninja version 1.10.1
    • pkg-config version 0.29.2

[✓] Android Studio (version 2024.1)
    • Android Studio at /home/gandalf/development/android-studio
    • Flutter plugin version 81.0.2
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314)

[✓] VS Code (version 1.93.1)
    • VS Code at /var/lib/flatpak/app/com.visualstudio.code/x86_64/stable/active/files/extra/vscode
    • Flutter extension version 3.94.0

[✓] Connected device (2 available)
    • sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64 • Android 13 (API 33) (emulator)
    • Linux (desktop)              • linux         • linux-x64   • Linux Mint 21.3 6.8.0-45-generic

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.
```

</details>