Repository: flutter
Issue: Engine crashes when AndroidView is used large size
Labels: c: crash,platform-android,engine,a: platform-views,has reproducible steps,P2,found in release: 3.3,found in release: 3.7,team-android,triaged-android

Most of them are coming up as issues for WebView, but when checked, it is not just an issue for WebView.

When the native UI component is wrapped and used as an AndroidView, a crash occurs when the View is increased in size to SizeBox.

It also occurs on any Android Device.

In building and operating a project using the Flutter framework, this seems to be a serious error as a whole.

The following reports are related to WebView large size
[#106999](https://github.com/flutter/flutter/issues/106999), [#104889](https://github.com/flutter/flutter/issues/104889), [#93115](https://github.com/flutter/flutter/issues/93115), [#45243](https://github.com/flutter/flutter/issues/45243), [#28978](https://github.com/flutter/flutter/issues/28978)

---

Example Full Soruce Code
https://github.com/JosephNK/flutter_native_view

<details>
<summary>Code</summary>

```dart
void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  late final WebViewController _webViewController;

  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: SingleChildScrollView(
          child: Column(
            children: [
              Container(color: Colors.orangeAccent, height: 50.0),
              _buildNativeView(),
              // _buildNativeWebView(),
              Container(color: Colors.pinkAccent, height: 50.0),
            ],
          ),
        ),
      ),
    );
  }

  Widget _buildNativeView() {
    return const SizedBox(
      height: 10000, // <-- For larger sizes, a crash occurs.
      child: NativeYellowView(),
    );
  }

  Widget _buildNativeWebView() {
    return SizedBox(
      height: 10000, // <-- For larger sizes, a crash occurs.
      child: NativeWebView(
        onWebViewCreated: (controller) {
          _webViewController = controller;
          controller.setUrl(url: 'https://flutter.dev/');
        },
      ),
    );
  }
}
```

</details>

<details>
<summary>Error Log</summary>

```
E/flutter (26904): [ERROR:flutter/fml/platform/android/jni_util.cc(204)] java.lang.RuntimeException: Error during updateTexImage (see logcat for details)
E/flutter (26904): 	at android.graphics.SurfaceTexture.nativeUpdateTexImage(Native Method)
E/flutter (26904): 	at android.graphics.SurfaceTexture.updateTexImage(SurfaceTexture.java:249)
E/flutter (26904): 	at io.flutter.embedding.engine.renderer.SurfaceTextureWrapper.updateTexImage(SurfaceTextureWrapper.java:55)
E/flutter (26904): 
F/flutter (26904): [FATAL:flutter/shell/platform/android/platform_view_android_jni_impl.cc(1319)] Check failed: fml::jni::CheckException(env). 
F/libc    (26904): Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 26940 (1.raster), pid 26904 (ve_view_example)
```

</details>

<details>
<summary>Flutter Doctor</summary>

```
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.3.9, on macOS 11.6.1 20G224 darwin-x64, locale ko-KR)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.3)
[✓] IntelliJ IDEA Ultimate Edition (version 2022.2)
[✓] VS Code (version 1.72.2)
[✓] Connected device (3 available)
[✓] HTTP Host Availability
```

</details>

![](https://raw.githubusercontent.com/JosephNK/flutter_native_view/main/screenshot/screenshot01.png)