Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Android] App crashes after upgrading to 2.10.x using webview + video_player plugin #98155

Closed
d3xt3r2909 opened this issue Feb 9, 2022 · 12 comments · Fixed by flutter/engine#31390
Assignees
Labels
a: platform-views Embedding Android/iOS views in Flutter apps c: crash Stack traces logged to the console c: fatal crash Crashes that terminate the process c: regression It was better in the past than it is now found in release: 2.10 Found to occur in 2.10 found in release: 2.11 Found to occur in 2.11 has reproducible steps The issue has been confirmed reproducible and is ready to work on p: webview The WebView plugin P1 High-priority issues at the top of the work list package flutter/packages repository. See also p: labels. platform-android Android applications specifically r: fixed Issue is closed as already fixed in a newer version

Comments

@d3xt3r2909
Copy link

d3xt3r2909 commented Feb 9, 2022

Seems like whenever there is another PlatformView active (tested with WebView plugin) and that view is disposed app is crashing.

Steps to reproduce:

  1. Add into list webview and videoplayer widget
  2. Play video
  3. Scroll so that webview is not visible anymore
  4. App is crashed

Tested on physical devices: Samsung S9 (Android 11), Pixel 3 (Android 12)

On iOS devices crash is not happening.

Screen recording:

Screen_Recording_20220209-230842_One.UI.Home.mp4
Min code to reproduce
import 'dart:math' as math;

import 'package:flutter/material.dart';
import 'package:video_player/video_player.dart';
import 'package:webview_flutter/webview_flutter.dart';

void main() => runApp(const VideoApp());

class VideoApp extends StatefulWidget {
  const VideoApp({final Key? key}) : super(key: key);

  @override
  _VideoAppState createState() => _VideoAppState();
}

class _VideoAppState extends State<VideoApp> {
  late VideoPlayerController _controller;

  @override
  void initState() {
    super.initState();
    _controller = VideoPlayerController.network(
      'https://flutter.github.io/assets-for-api-docs/assets/videos/bee.mp4',
    )
      ..initialize()
      ..setLooping(true)
      ..play().then((_) {
        // Ensure the first frame is shown after the video is initialized,
        // even before the play button has been pressed.
        setState(() {});
      });
  }

  @override
  Widget build(final BuildContext context) {
    return MaterialApp(
      title: 'Video Demo',
      home: Scaffold(
        body: ListView(
          children: [
            ..._generateChildren(5),
            const SizedBox(
              height: 200,
              child: WebView(
                initialUrl:
                    'https://www.youtube.com/watch?v=oYnpQ3Mjg_g&ab_channel=TeslaDaily',
                javascriptMode: JavascriptMode.unrestricted,
              ),
            ),
            Center(
              child: _controller.value.isInitialized
                  ? AspectRatio(
                      aspectRatio: _controller.value.aspectRatio,
                      child: VideoPlayer(_controller),
                    )
                  : const SizedBox(),
            ),
            ..._generateChildren(10),
          ],
        ),
        floatingActionButton: FloatingActionButton(
          onPressed: () {
            setState(() {
              _controller.value.isPlaying
                  ? _controller.pause()
                  : _controller.play();
            });
          },
          child: Icon(
            _controller.value.isPlaying ? Icons.pause : Icons.play_arrow,
          ),
        ),
      ),
    );
  }

  List<Widget> _generateChildren(final int number) {
    final List<Widget> children = [];

    for (var i = 0; i < number; i++) {
      children.add(
        Container(
          height: 80,
          color: Color((math.Random().nextDouble() * 0xFFFFFF).toInt())
              .withOpacity(1),
        ),
      );
    }

    return children;
  }

  @override
  void dispose() {
    super.dispose();
    _controller.dispose();
  }
}
Crash log
E/n.staging.debu(28654): [SurfaceTexture-0-28654-0] attachToContext: SurfaceTexture is already attached to a context
E/flutter (28654): [ERROR:flutter/fml/platform/android/jni_util.cc(211)] java.lang.RuntimeException: Error during attachToGLContext (see logcat for details)
E/flutter (28654): 	at android.graphics.SurfaceTexture.attachToGLContext(SurfaceTexture.java:295)
E/flutter (28654): 	at io.flutter.embedding.engine.renderer.SurfaceTextureWrapper.attachToGLContext(SurfaceTextureWrapper.java:57)
E/flutter (28654): 	at android.os.MessageQueue.nativePollOnce(Native Method)
E/flutter (28654): 	at android.os.MessageQueue.next(MessageQueue.java:335)
E/flutter (28654): 	at android.os.Looper.loop(Looper.java:206)
E/flutter (28654): 	at android.app.ActivityThread.main(ActivityThread.java:8633)
E/flutter (28654): 	at java.lang.reflect.Method.invoke(Native Method)
E/flutter (28654): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
E/flutter (28654): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)
Flutter doctor
  [✓] Flutter (Channel unknown, 2.10.0-0.3.pre, on Mac OS X 10.15.7 19H1615 darwin-x64, locale en-GB)
    • Flutter version 2.10.0-0.3.pre at /Users/ndelic/development/flutter
    • Upstream repository unknown
    • Framework revision fdd0af78bb (2 weeks ago), 2022-01-25 22:01:33 -0600
    • Engine revision 5ac30ef0c7
    • Dart version 2.16.0 (build 2.16.0-134.5.beta)
    • DevTools version 2.9.2

[✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
    • Android SDK at /Users/ndelic/Library/Android/sdk
    • Platform android-31, build-tools 32.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)
    • All Android licenses accepted.

[!] Xcode - develop for iOS and macOS (Xcode 12.4)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    ! Flutter recommends a minimum Xcode version of 13.
      Download the latest version or update via the Mac App Store.
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • 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.11+0-b60-7590822)

[!] Android Studio
    • Android Studio at /Users/ndelic/Downloads/Android Studio Preview.app/Contents
    • 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
    ✗ Unable to find bundled Java version.
    • Try updating or re-installing Android Studio.

[✓] Connected device (4 available)
    • SM G973F (mobile)            • R38MA099L6V   • android-arm64  • Android 11 (API 30)
    • AOSP on IA Emulator (mobile) • emulator-5554 • android-x86    • Android 9 (API 28) (emulator)
    • macOS (desktop)              • macos         • darwin-x64     • Mac OS X 10.15.7 19H1615 darwin-x64
    • Chrome (web)                 • chrome        • web-javascript • Google Chrome 98.0.4758.80

[✓] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 2 categories.

Please let me know if you need more details. This was not happening while running flutter 2.8.x (didn't test with beta 2.9.x)

@d3xt3r2909
Copy link
Author

d3xt3r2909 commented Feb 9, 2022

This could be related #97904 but plugins are not the same. Probably something about platform views?

PS mentioned issue is using example with 3th party library and this issue is using 1th party library and there is same crash

Also this issue #97283 could be related but as you can see I am not using whats mentioned inside #97283 (comment)

@d3xt3r2909 d3xt3r2909 changed the title [video_player] App crashes after upgrading to 2.10.x and using webview plugin [video_player][Android] App crashes after upgrading to 2.10.x and using webview plugin Feb 9, 2022
@akilanfidelis
Copy link

akilanfidelis commented Feb 10, 2022

I have video_player plugin:2.2.16

I get similar crash when i move to next screen to pause and come back to resume playing.

logs
 [   +1 ms] E/flutter ( 7155): [ERROR:flutter/fml/platform/android/jni_util.cc(211)] java.lang.RuntimeException: Error during attachToGLContext (see logcat for details)
[        ] E/flutter ( 7155): 	at android.graphics.SurfaceTexture.attachToGLContext(SurfaceTexture.java:295)
[        ] E/flutter ( 7155): 	at io.flutter.embedding.engine.renderer.SurfaceTextureWrapper.attachToGLContext(SurfaceTextureWrapper.java:57)
[        ] E/flutter ( 7155): 	at android.os.MessageQueue.nativePollOnce(Native Method)
[        ] E/flutter ( 7155): 	at android.os.MessageQueue.next(MessageQueue.java:335)
[        ] E/flutter ( 7155): 	at android.os.Looper.loop(Looper.java:183)
[        ] E/flutter ( 7155): 	at android.app.ActivityThread.main(ActivityThread.java:7664)
[        ] E/flutter ( 7155): 	at java.lang.reflect.Method.invoke(Native Method)
[        ] E/flutter ( 7155): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
[        ] E/flutter ( 7155): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
[        ] E/flutter ( 7155): 
[        ] F/flutter ( 7155): [FATAL:flutter/shell/platform/android/platform_view_android_jni_impl.cc(1301)] Check failed: fml::jni::CheckException(env). 
[ +438 ms] I/flutter ( 7155): VideoWatch start id 612aed277eb140b302d79999 duration 26 
[        ] I/flutter ( 7155):           hashtagList [facebook,instagram,whatsapp, lovelover, newhashtag, animal]  category [Pets] source ugc
[ +442 ms] E/Unknow  ( 7155): [TXCIOListener.cpp, Listen, 698]:listen failed|error:4|info:Interrupted system call
[  +25 ms] F/libc    ( 7155): Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 7155 (yer.musicplayer), pid 7155 (yer.musicplayer)
[ +541 ms] *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
[        ] Build fingerprint: 'Realme/RMX1851/RMX1851:11/RQ3A.210905.001/1126:user/test-keys'
[        ] Revision: '0'
[        ] ABI: 'arm64'
[        ] Timestamp: 2022-02-10 11:53:09+0530
[        ] pid: 7155, tid: 7155, name: yer.musicplayer  >>> playit.videoplayer.musicplayer <<<
[        ] uid: 10245
[        ] signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
[        ] Abort message: '[FATAL:flutter/shell/platform/android/platform_view_android_jni_impl.cc(1301)] Check failed: fml::jni::CheckException(env). 
[        ] '
[        ]     x0  0000000000000000  x1  0000000000001bf3  x2  0000000000000006  x3  0000007fe7441c70
[        ]     x4  6e70ff091f2d2875  x5  6e70ff091f2d2875  x6  6e70ff091f2d2875  x7  7f7f7f7f7f7f7f7f
[        ]     x8  00000000000000f0  x9  de300eafa40e8620  x10 0000000000000000  x11 ffffffc0fffffbdf
[        ]     x12 0000000000000001  x13 000000000000007e  x14 00146b39c82c0665  x15 00000000003847a6
[        ]     x16 00000073942ccc80  x17 00000073942aec10  x18 0000000045cf8a45  x19 0000000000001bf3
[        ]     x20 0000000000001bf3  x21 00000000ffffffff  x22 0000007174082648  x23 0000007164029388
[        ]     x24 0000007194001f50  x25 0000000000000000  x26 0000000000000001  x27 0000000000000001
[        ]     x28 0000000000000005  x29 0000007fe7441cf0
[        ]     lr  00000073942612a0  sp  0000007fe7441c50  pc  00000073942612cc  pst 0000000000000000
[ +304 ms] backtrace:
[        ]       #00 pc 000000000004e2cc  /apex/com.android.runtime/lib64/bionic/libc.so (abort+164) (BuildId: be9c72fe4db37cd191b589b74d090d13)
[        ]       #01 pc 000000000150a880  /data/app/~~V3uYpUcX0eHFXlSse1rHow==/playit.videoplayer.musicplayer-woTSNmO_kLuwMsGpUc6SWw==/lib/arm64/libflutter.so (BuildId: 5650bb2df5ace86ba3c9913ef48b56eb77fbc72d)
[        ]       #02 pc 000000000152c920  /data/app/~~V3uYpUcX0eHFXlSse1rHow==/playit.videoplayer.musicplayer-woTSNmO_kLuwMsGpUc6SWw==/lib/arm64/libflutter.so (BuildId: 5650bb2df5ace86ba3c9913ef48b56eb77fbc72d)
[        ]       #03 pc 0000000001513868  /data/app/~~V3uYpUcX0eHFXlSse1rHow==/playit.videoplayer.musicplayer-woTSNmO_kLuwMsGpUc6SWw==/lib/arm64/libflutter.so (BuildId: 5650bb2df5ace86ba3c9913ef48b56eb77fbc72d)
[        ]       #04 pc 000000000150971c  /data/app/~~V3uYpUcX0eHFXlSse1rHow==/playit.videoplayer.musicplayer-woTSNmO_kLuwMsGpUc6SWw==/lib/arm64/libflutter.so (BuildId: 5650bb2df5ace86ba3c9913ef48b56eb77fbc72d)
[        ]       #05 pc 000000000150958c  /data/app/~~V3uYpUcX0eHFXlSse1rHow==/playit.videoplayer.musicplayer-woTSNmO_kLuwMsGpUc6SWw==/lib/arm64/libflutter.so (BuildId: 5650bb2df5ace86ba3c9913ef48b56eb77fbc72d)
[        ]       #06 pc 000000000182d004  /data/app/~~V3uYpUcX0eHFXlSse1rHow==/playit.videoplayer.musicplayer-woTSNmO_kLuwMsGpUc6SWw==/lib/arm64/libflutter.so (BuildId: 5650bb2df5ace86ba3c9913ef48b56eb77fbc72d)
[        ]       #07 pc 0000000001829c24  /data/app/~~V3uYpUcX0eHFXlSse1rHow==/playit.videoplayer.musicplayer-woTSNmO_kLuwMsGpUc6SWw==/lib/arm64/libflutter.so (BuildId: 5650bb2df5ace86ba3c9913ef48b56eb77fbc72d)
[        ]       #08 pc 000000000182d360  /data/app/~~V3uYpUcX0eHFXlSse1rHow==/playit.videoplayer.musicplayer-woTSNmO_kLuwMsGpUc6SWw==/lib/arm64/libflutter.so (BuildId: 5650bb2df5ace86ba3c9913ef48b56eb77fbc72d)
[        ]       #09 pc 0000000001829c24  /data/app/~~V3uYpUcX0eHFXlSse1rHow==/playit.videoplayer.musicplayer-woTSNmO_kLuwMsGpUc6SWw==/lib/arm64/libflutter.so (BuildId: 5650bb2df5ace86ba3c9913ef48b56eb77fbc72d)
[        ]       #10 pc 000000000182d360  /data/app/~~V3uYpUcX0eHFXlSse1rHow==/playit.videoplayer.musicplayer-woTSNmO_kLuwMsGpUc6SWw==/lib/arm64/libflutter.so (BuildId: 5650bb2df5ace86ba3c9913ef48b56eb77fbc72d)
[        ]       #11 pc 0000000001829c24  /data/app/~~V3uYpUcX0eHFXlSse1rHow==/playit.videoplayer.musicplayer-woTSNmO_kLuwMsGpUc6SWw==/lib/arm64/libflutter.so (BuildId: 5650bb2df5ace86ba3c9913ef48b56eb77fbc72d)
[   +1 ms]       #12 pc 000000000182d360  /data/app/~~V3uYpUcX0eHFXlSse1rHow==/playit.videoplayer.musicplayer-woTSNmO_kLuwMsGpUc6SWw==/lib/arm64/libflutter.so (BuildId: 5650bb2df5ace86ba3c9913ef48b56eb77fbc72d)
[        ]       #13 pc 0000000001829c24  /data/app/~~V3uYpUcX0eHFXlSse1rHow==/playit.videoplayer.musicplayer-woTSNmO_kLuwMsGpUc6SWw==/lib/arm64/libflutter.so (BuildId: 5650bb2df5ace86ba3c9913ef48b56eb77fbc72d)
[        ]       #14 pc 0000000001828fd0  /data/app/~~V3uYpUcX0eHFXlSse1rHow==/playit.videoplayer.musicplayer-woTSNmO_kLuwMsGpUc6SWw==/lib/arm64/libflutter.so (BuildId: 5650bb2df5ace86ba3c9913ef48b56eb77fbc72d)
[        ]       #15 pc 0000000001829c24  /data/app/~~V3uYpUcX0eHFXlSse1rHow==/playit.videoplayer.musicplayer-woTSNmO_kLuwMsGpUc6SWw==/lib/arm64/libflutter.so (BuildId: 5650bb2df5ace86ba3c9913ef48b56eb77fbc72d)
[   +3 ms]       #16 pc 000000000182d360  /data/app/~~V3uYpUcX0eHFXlSse1rHow==/playit.videoplayer.musicplayer-woTSNmO_kLuwMsGpUc6SWw==/lib/arm64/libflutter.so (BuildId: 5650bb2df5ace86ba3c9913ef48b56eb77fbc72d)
[        ]       #17 pc 0000000001829c24  /data/app/~~V3uYpUcX0eHFXlSse1rHow==/playit.videoplayer.musicplayer-woTSNmO_kLuwMsGpUc6SWw==/lib/arm64/libflutter.so (BuildId: 5650bb2df5ace86ba3c9913ef48b56eb77fbc72d)
[        ]       #18 pc 000000000182d360  /data/app/~~V3uYpUcX0eHFXlSse1rHow==/playit.videoplayer.musicplayer-woTSNmO_kLuwMsGpUc6SWw==/lib/arm64/libflutter.so (BuildId: 5650bb2df5ace86ba3c9913ef48b56eb77fbc72d)
[        ]       #19 pc 0000000001829c24  /data/app/~~V3uYpUcX0eHFXlSse1rHow==/playit.videoplayer.musicplayer-woTSNmO_kLuwMsGpUc6SWw==/lib/arm64/libflutter.so (BuildId: 5650bb2df5ace86ba3c9913ef48b56eb77fbc72d)
[        ]       #20 pc 000000000182d360  /data/app/~~V3uYpUcX0eHFXlSse1rHow==/playit.videoplayer.musicplayer-woTSNmO_kLuwMsGpUc6SWw==/lib/arm64/libflutter.so (BuildId: 5650bb2df5ace86ba3c9913ef48b56eb77fbc72d)
[        ]       #21 pc 0000000001829c24  /data/app/~~V3uYpUcX0eHFXlSse1rHow==/playit.videoplayer.musicplayer-woTSNmO_kLuwMsGpUc6SWw==/lib/arm64/libflutter.so (BuildId: 5650bb2df5ace86ba3c9913ef48b56eb77fbc72d)
[        ]       #22 pc 000000000182d360  /data/app/~~V3uYpUcX0eHFXlSse1rHow==/playit.videoplayer.musicplayer-woTSNmO_kLuwMsGpUc6SWw==/lib/arm64/libflutter.so (BuildId: 5650bb2df5ace86ba3c9913ef48b56eb77fbc72d)
[        ]       #23 pc 0000000001829c24  /data/app/~~V3uYpUcX0eHFXlSse1rHow==/playit.videoplayer.musicplayer-woTSNmO_kLuwMsGpUc6SWw==/lib/arm64/libflutter.so (BuildId: 5650bb2df5ace86ba3c9913ef48b56eb77fbc72d)
[        ]       #24 pc 0000000001828fd0  /data/app/~~V3uYpUcX0eHFXlSse1rHow==/playit.videoplayer.musicplayer-woTSNmO_kLuwMsGpUc6SWw==/lib/arm64/libflutter.so (BuildId: 5650bb2df5ace86ba3c9913ef48b56eb77fbc72d)
[        ]       #25 pc 0000000001829c24  /data/app/~~V3uYpUcX0eHFXlSse1rHow==/playit.videoplayer.musicplayer-woTSNmO_kLuwMsGpUc6SWw==/lib/arm64/libflutter.so (BuildId: 5650bb2df5ace86ba3c9913ef48b56eb77fbc72d)
[        ]       #26 pc 000000000182d360  /data/app/~~V3uYpUcX0eHFXlSse1rHow==/playit.videoplayer.musicplayer-woTSNmO_kLuwMsGpUc6SWw==/lib/arm64/libflutter.so (BuildId: 5650bb2df5ace86ba3c9913ef48b56eb77fbc72d)
[        ]       #27 pc 0000000001829c24  /data/app/~~V3uYpUcX0eHFXlSse1rHow==/playit.videoplayer.musicplayer-woTSNmO_kLuwMsGpUc6SWw==/lib/arm64/libflutter.so (BuildId: 5650bb2df5ace86ba3c9913ef48b56eb77fbc72d)
[        ]       #28 pc 000000000182d360  /data/app/~~V3uYpUcX0eHFXlSse1rHow==/playit.videoplayer.musicplayer-woTSNmO_kLuwMsGpUc6SWw==/lib/arm64/libflutter.so (BuildId: 5650bb2df5ace86ba3c9913ef48b56eb77fbc72d)
[        ]       #29 pc 0000000001829c24  /data/app/~~V3uYpUcX0eHFXlSse1rHow==/playit.videoplayer.musicplayer-woTSNmO_kLuwMsGpUc6SWw==/lib/arm64/libflutter.so (BuildId: 5650bb2df5ace86ba3c9913ef48b56eb77fbc72d)
[        ]       #30 pc 000000000182d360  /data/app/~~V3uYpUcX0eHFXlSse1rHow==/playit.videoplayer.musicplayer-woTSNmO_kLuwMsGpUc6SWw==/lib/arm64/libflutter.so (BuildId: 5650bb2df5ace86ba3c9913ef48b56eb77fbc72d)
[        ]       #31 pc 0000000001829c24  /data/app/~~V3uYpUcX0eHFXlSse1rHow==/playit.videoplayer.musicplayer-woTSNmO_kLuwMsGpUc6SWw==/lib/arm64/libflutter.so (BuildId: 5650bb2df5ace86ba3c9913ef48b56eb77fbc72d)
[        ]       #32 pc 000000000182c058  /data/app/~~V3uYpUcX0eHFXlSse1rHow==/playit.videoplayer.musicplayer-woTSNmO_kLuwMsGpUc6SWw==/lib/arm64/libflutter.so (BuildId: 5650bb2df5ace86ba3c9913ef48b56eb77fbc72d)
[        ]       #33 pc 0000000001829c24  /data/app/~~V3uYpUcX0eHFXlSse1rHow==/playit.videoplayer.musicplayer-woTSNmO_kLuwMsGpUc6SWw==/lib/arm64/libflutter.so (BuildId: 5650bb2df5ace86ba3c9913ef48b56eb77fbc72d)
[        ]       #34 pc 000000000182d360  /data/app/~~V3uYpUcX0eHFXlSse1rHow==/playit.videoplayer.musicplayer-woTSNmO_kLuwMsGpUc6SWw==/lib/arm64/libflutter.so (BuildId: 5650bb2df5ace86ba3c9913ef48b56eb77fbc72d)
[        ]       #35 pc 0000000001829c24  /data/app/~~V3uYpUcX0eHFXlSse1rHow==/playit.videoplayer.musicplayer-woTSNmO_kLuwMsGpUc6SWw==/lib/arm64/libflutter.so (BuildId: 5650bb2df5ace86ba3c9913ef48b56eb77fbc72d)
[        ]       #36 pc 000000000182d360  /data/app/~~V3uYpUcX0eHFXlSse1rHow==/playit.videoplayer.musicplayer-woTSNmO_kLuwMsGpUc6SWw==/lib/arm64/libflutter.so (BuildId: 5650bb2df5ace86ba3c9913ef48b56eb77fbc72d)
[        ]       #37 pc 0000000001829c24  /data/app/~~V3uYpUcX0eHFXlSse1rHow==/playit.videoplayer.musicplayer-woTSNmO_kLuwMsGpUc6SWw==/lib/arm64/libflutter.so (BuildId: 5650bb2df5ace86ba3c9913ef48b56eb77fbc72d)
[        ]       #38 pc 000000000182d360  /data/app/~~V3uYpUcX0eHFXlSse1rHow==/playit.videoplayer.musicplayer-woTSNmO_kLuwMsGpUc6SWw==/lib/arm64/libflutter.so (BuildId: 5650bb2df5ace86ba3c9913ef48b56eb77fbc72d)
[        ]       #39 pc 0000000001829c24  /data/app/~~V3uYpUcX0eHFXlSse1rHow==/playit.videoplayer.musicplayer-woTSNmO_kLuwMsGpUc6SWw==/lib/arm64/libflutter.so (BuildId: 5650bb2df5ace86ba3c9913ef48b56eb77fbc72d)
[        ]       #40 pc 000000000182d360  /data/app/~~V3uYpUcX0eHFXlSse1rHow==/playit.videoplayer.musicplayer-woTSNmO_kLuwMsGpUc6SWw==/lib/arm64/libflutter.so (BuildId: 5650bb2df5ace86ba3c9913ef48b56eb77fbc72d)
[        ]       #41 pc 0000000001829c24  /data/app/~~V3uYpUcX0eHFXlSse1rHow==/playit.videoplayer.musicplayer-woTSNmO_kLuwMsGpUc6SWw==/lib/arm64/libflutter.so (BuildId: 5650bb2df5ace86ba3c9913ef48b56eb77fbc72d)
[        ]       #42 pc 000000000182b0c4  /data/app/~~V3uYpUcX0eHFXlSse1rHow==/playit.videoplayer.musicplayer-woTSNmO_kLuwMsGpUc6SWw==/lib/arm64/libflutter.so (BuildId: 5650bb2df5ace86ba3c9913ef48b56eb77fbc72d)
[        ]       #43 pc 00000000018266fc  /data/app/~~V3uYpUcX0eHFXlSse1rHow==/playit.videoplayer.musicplayer-woTSNmO_kLuwMsGpUc6SWw==/lib/arm64/libflutter.so (BuildId: 5650bb2df5ace86ba3c9913ef48b56eb77fbc72d)
[        ]       #44 pc 000000000183f970  /data/app/~~V3uYpUcX0eHFXlSse1rHow==/playit.videoplayer.musicplayer-woTSNmO_kLuwMsGpUc6SWw==/lib/arm64/libflutter.so (BuildId: 5650bb2df5ace86ba3c9913ef48b56eb77fbc72d)
[        ]       #45 pc 000000000183e768  /data/app/~~V3uYpUcX0eHFXlSse1rHow==/playit.videoplayer.musicplayer-woTSNmO_kLuwMsGpUc6SWw==/lib/arm64/libflutter.so (BuildId: 5650bb2df5ace86ba3c9913ef48b56eb77fbc72d)
[        ]       #46 pc 000000000183f230  /data/app/~~V3uYpUcX0eHFXlSse1rHow==/playit.videoplayer.musicplayer-woTSNmO_kLuwMsGpUc6SWw==/lib/arm64/libflutter.so (BuildId: 5650bb2df5ace86ba3c9913ef48b56eb77fbc72d)
[        ]       #47 pc 0000000001840024  /data/app/~~V3uYpUcX0eHFXlSse1rHow==/playit.videoplayer.musicplayer-woTSNmO_kLuwMsGpUc6SWw==/lib/arm64/libflutter.so (BuildId: 5650bb2df5ace86ba3c9913ef48b56eb77fbc72d)
[        ]       #48 pc 000000000183eb98  /data/app/~~V3uYpUcX0eHFXlSse1rHow==/playit.videoplayer.musicplayer-woTSNmO_kLuwMsGpUc6SWw==/lib/arm64/libflutter.so (BuildId: 5650bb2df5ace86ba3c9913ef48b56eb77fbc72d)
[        ]       #49 pc 000000000183e904  /data/app/~~V3uYpUcX0eHFXlSse1rHow==/playit.videoplayer.musicplayer-woTSNmO_kLuwMsGpUc6SWw==/lib/arm64/libflutter.so (BuildId: 5650bb2df5ace86ba3c9913ef48b56eb77fbc72d)
[        ]       #50 pc 000000000184a5b8  /data/app/~~V3uYpUcX0eHFXlSse1rHow==/playit.videoplayer.musicplayer-woTSNmO_kLuwMsGpUc6SWw==/lib/arm64/libflutter.so (BuildId: 5650bb2df5ace86ba3c9913ef48b56eb77fbc72d)
[        ]       #51 pc 000000000152d5e0  /data/app/~~V3uYpUcX0eHFXlSse1rHow==/playit.videoplayer.musicplayer-woTSNmO_kLuwMsGpUc6SWw==/lib/arm64/libflutter.so (BuildId: 5650bb2df5ace86ba3c9913ef48b56eb77fbc72d)
[        ]       #52 pc 0000000001533b4c  /data/app/~~V3uYpUcX0eHFXlSse1rHow==/playit.videoplayer.musicplayer-woTSNmO_kLuwMsGpUc6SWw==/lib/arm64/libflutter.so (BuildId: 5650bb2df5ace86ba3c9913ef48b56eb77fbc72d)
[        ]       #53 pc 0000000000019dac  /system/lib64/libutils.so (android::Looper::pollInner(int)+916) (BuildId: ceae7b3f2b98c0819dea4df81964a864)
[        ]       #54 pc 00000000000199b0  /system/lib64/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+112) (BuildId: ceae7b3f2b98c0819dea4df81964a864)
[        ]       #55 pc 0000000000112194  /system/lib64/libandroid_runtime.so (android::android_os_MessageQueue_nativePollOnce(_JNIEnv*, _jobject*, long, int)+44) (BuildId: 01c6c0c7f0221e04294909de9db987f9)
[        ]       #56 pc 0000000000211c0c  /system/framework/arm64/boot-framework.oat (art_jni_trampoline+140) (BuildId: 01f00d213a45eaff468fa1a2e7f9dbab4ada44c7)
[        ]       #57 pc 000000000201dbc4  /memfd:jit-cache (deleted) (offset 0x2000000) (android.os.MessageQueue.next+196)
[        ]       #58 pc 0000000000133564  /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: b047970977b60c66feb06522edaad403)
[        ]       #59 pc 00000000001a8a78  /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+200) (BuildId: b047970977b60c66feb06522edaad403)
[        ]       #60 pc 000000000031831c  /apex/com.android.art/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+376) (BuildId: b047970977b60c66feb06522edaad403)
[   +1 ms]       #61 pc 000000000030e648  /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+996) (BuildId: b047970977b60c66feb06522edaad403)
[        ]       #62 pc 000000000067c544  /apex/com.android.art/lib64/libart.so (MterpInvokeVirtual+848) (BuildId: b047970977b60c66feb06522edaad403)
[        ]       #63 pc 000000000012d814  /apex/com.android.art/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: b047970977b60c66feb06522edaad403)
[        ]       #64 pc 000000000038770e  /system/framework/framework.jar (offset 0x85a000) (android.os.Looper.loop+154)
[        ]       #65 pc 0000000000305c44  /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.15486036983929349625)+268) (BuildId: b047970977b60c66feb06522edaad403)
[        ]       #66 pc 000000000030dc34  /apex/com.android.art/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+200) (BuildId: b047970977b60c66feb06522edaad403)
[        ]       #67 pc 000000000030f01c  /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false, true>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+1772) (BuildId: b047970977b60c66feb06522edaad403)
[        ]       #68 pc 0000000000177f40  /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp<true, false>(art::interpreter::SwitchImplContext*)+57848) (BuildId: b047970977b60c66feb06522edaad403)
[        ]       #69 pc 000000000013f7d8  /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+8) (BuildId: b047970977b60c66feb06522edaad403)
[        ]       #70 pc 0000000000197ea0  /system/framework/framework.jar (android.app.ActivityThread.main)
[        ]       #71 pc 0000000000305d4c  /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.15486036983929349625)+532) (BuildId: b047970977b60c66feb06522edaad403)
[        ]       #72 pc 000000000066b24c  /apex/com.android.art/lib64/libart.so (artQuickToInterpreterBridge+780) (BuildId: b047970977b60c66feb06522edaad403)
[        ]       #73 pc 000000000013cff8  /apex/com.android.art/lib64/libart.so (art_quick_to_interpreter_bridge+88) (BuildId: b047970977b60c66feb06522edaad403)
[        ]       #74 pc 00000000001337e8  /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+568) (BuildId: b047970977b60c66feb06522edaad403)
[        ]       #75 pc 00000000001a8a94  /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+228) (BuildId: b047970977b60c66feb06522edaad403)
[        ]       #76 pc 0000000000555748  /apex/com.android.art/lib64/libart.so (art::InvokeMethod(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jobject*, _jobject*, unsigned long)+1364) (BuildId: b047970977b60c66feb06522edaad403)
[        ]       #77 pc 00000000004d4ef0  /apex/com.android.art/lib64/libart.so (art::Method_invoke(_JNIEnv*, _jobject*, _jobject*, _jobjectArray*)+52) (BuildId: b047970977b60c66feb06522edaad403)
[        ]       #78 pc 000000000008a6f4  /apex/com.android.art/javalib/arm64/boot.oat (art_jni_trampoline+180) (BuildId: fd3cf054c28fb5d3737a5d92c072cfb27c32c982)
[        ]       #79 pc 0000000000133564  /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: b047970977b60c66feb06522edaad403)
[        ]       #80 pc 00000000001a8a78  /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+200) (BuildId: b047970977b60c66feb06522edaad403)
[        ]       #81 pc 000000000031831c  /apex/com.android.art/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+376) (BuildId: b047970977b60c66feb06522edaad403)
[   +1 ms]       #82 pc 000000000030e648  /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+996) (BuildId: b047970977b60c66feb06522edaad403)
[        ]       #83 pc 000000000067c544  /apex/com.android.art/lib64/libart.so (MterpInvokeVirtual+848) (BuildId: b047970977b60c66feb06522edaad403)
[        ]       #84 pc 000000000012d814  /apex/com.android.art/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: b047970977b60c66feb06522edaad403)
[        ]       #85 pc 00000000004430fe  /system/framework/framework.jar (offset 0x10d6000) (com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run+22)
[        ]       #86 pc 0000000000305c44  /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.15486036983929349625)+268) (BuildId: b047970977b60c66feb06522edaad403)
[        ]       #87 pc 000000000066b24c  /apex/com.android.art/lib64/libart.so (artQuickToInterpreterBridge+780) (BuildId: b047970977b60c66feb06522edaad403)
[        ]       #88 pc 000000000013cff8  /apex/com.android.art/lib64/libart.so (art_quick_to_interpreter_bridge+88) (BuildId: b047970977b60c66feb06522edaad403)
[        ]       #89 pc 00000000008b8494  /system/framework/arm64/boot-framework.oat (com.android.internal.os.ZygoteInit.main+2212) (BuildId: 01f00d213a45eaff468fa1a2e7f9dbab4ada44c7)
[        ]       #90 pc 00000000001337e8  /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+568) (BuildId: b047970977b60c66feb06522edaad403)
[        ]       #91 pc 00000000001a8a94  /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+228) (BuildId: b047970977b60c66feb06522edaad403)
[        ]       #92 pc 0000000000554184  /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeWithVarArgs<art::ArtMethod*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, std::__va_list)+448) (BuildId: b047970977b60c66feb06522edaad403)
[        ]       #93 pc 0000000000554638  /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeWithVarArgs<_jmethodID*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, std::__va_list)+92) (BuildId: b047970977b60c66feb06522edaad403)
[        ]       #94 pc 0000000000438b08  /apex/com.android.art/lib64/libart.so (art::JNI<true>::CallStaticVoidMethodV(_JNIEnv*, _jclass*, _jmethodID*, std::__va_list)+656) (BuildId: b047970977b60c66feb06522edaad403)
[        ]       #95 pc 000000000009944c  /system/lib64/libandroid_runtime.so (_JNIEnv::CallStaticVoidMethod(_jclass*, _jmethodID*, ...)+124) (BuildId: 01c6c0c7f0221e04294909de9db987f9)
[        ]       #96 pc 00000000000a0b34  /system/lib64/libandroid_runtime.so (android::AndroidRuntime::start(char const*, android::Vector<android::String8> const&, bool)+756) (BuildId: 01c6c0c7f0221e04294909de9db987f9)
[        ]       #97 pc 0000000000003580  /system/bin/app_process64 (main+1336) (BuildId: 8b041fc279d5108900e48324bafa5142)
[        ]       #98 pc 000000000004988c  /apex/com.android.runtime/lib64/bionic/libc.so (__libc_init+108) (BuildId: be9c72fe4db37cd191b589b74d090d13)
[ +794 ms] Service protocol connection closed.
[   +1 ms] Lost connection to device.

@maheshj01 maheshj01 added the in triage Presently being triaged by the triage team label Feb 10, 2022
@maheshj01
Copy link
Member

maheshj01 commented Feb 10, 2022

Hi @d3xt3r2909, Thanks for filing the issue. I was able to reproduce the crash with the latest plugins on stable and the master channel.

  video_player: ^2.2.18
  webview_flutter: ^3.0.0

steps to reproduce

  • run the above code sample
  • pause the video and scroll to top
Screen.Recording.2022-02-10.at.2.35.43.PM.mov
E/.example.sampl(22447): [SurfaceTexture-0-22447-0] attachToContext: SurfaceTexture is already attached to a context
E/flutter (22447): [ERROR:flutter/fml/platform/android/jni_util.cc(211)] java.lang.RuntimeException: Error during attachToGLContext (see logcat for details)
E/flutter (22447): 	at android.graphics.SurfaceTexture.attachToGLContext(SurfaceTexture.java:295)
E/flutter (22447): 	at io.flutter.embedding.engine.renderer.SurfaceTextureWrapper.attachToGLContext(SurfaceTextureWrapper.java:57)
E/flutter (22447): 	at android.os.MessageQueue.nativePollOnce(Native Method)
E/flutter (22447): 	at android.os.MessageQueue.next(MessageQueue.java:335)
E/flutter (22447): 	at android.os.Looper.loop(Looper.java:193)
E/flutter (22447): 	at android.app.ActivityThread.main(ActivityThread.java:8061)
E/flutter (22447): 	at java.lang.reflect.Method.invoke(Native Method)
E/flutter (22447): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:656)
E/flutter (22447): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967)
F/libc    (22447): Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 22447 (.example.sample), pid 22447 (.example.sample)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'Xiaomi/raphaelin/raphaelin:11/RKQ1.200826.002/V12.5.1.0.RFKINXM:user/release-keys'
Revision: '0'
ABI: 'arm64'
Timestamp: 2022-02-10 14:56:31+0530
pid: 22447, tid: 22447, name: .example.sample  >>> com.example.sample <<<
uid: 10978
signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
Abort message: '[FATAL:flutter/shell/platform/android/platform_view_android_jni_impl.cc(1301)] Check failed: fml::jni::CheckException(env).
'
    x0  0000000000000000  x1  00000000000057af  x2  0000000000000006  x3  0000007ffd6cb820
    x4  00000076526f2000  x5  00000076526f2000  x6  00000076526f2000  x7  00000000034aff18
    x8  00000000000000f0  x9  4add9feee65b50b6  x10 0000000000000000  x11 ffffffc0fffffbdf
    x12 0000000000000001  x13 000000006204da46  x14 0013ed70dac978a3  x15 000059415314c319
    x16 000000764c462948  x17 000000764c43f490  x18 0000007651a96000  x19 00000000000057af
    x20 00000000000057af  x21 00000000ffffffff  x22 b4000075bae1c918  x23 b400007523d0f528
    x24 b4000075baeafc80  x25 0000000000000000  x26 0000000000000001  x27 0000000000000047
    x28 0000000000000001  x29 0000007ffd6cb8a0
    lr  000000764c3eecf8  sp  0000007ffd6cb800  pc  000000764c3eed24  pst 0000000000000000
backtrace:

complete logs can be found here logs.zip

flutter doctor -v
[✓] Flutter (Channel stable, 2.10.1, on macOS 12.1 21C52 darwin-arm, locale en-GB)
    • Flutter version 2.10.1 at /Users/mahesh/Documents/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision db747aa133 (13 hours ago), 2022-02-09 13:57:35 -0600
    • Engine revision ab46186b24
    • Dart version 2.16.1
    • DevTools version 2.9.2

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/mahesh/Library/Android/sdk
    • Platform android-31, build-tools 31.0.0
    • ANDROID_HOME = /Users/mahesh/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.10.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • 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.8+10-b944.6916264)

[✓] IntelliJ IDEA Community Edition (version 2021.2.1)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 61.2.4
    • Dart plugin version 212.5080.8

[✓] VS Code (version 1.63.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.34.0

[✓] Connected device (3 available)
    • Redmi K20 Pro (mobile) • 192.168.1.2:5555 • android-arm64  • Android 11 (API 30)
    • macOS (desktop)        • macos            • darwin-arm64   • macOS 12.1 21C52 darwin-arm
    • Chrome (web)           • chrome           • web-javascript • Google Chrome 98.0.4758.80

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!
[✓] Flutter (Channel master, 2.11.0-0.0.pre.452, on macOS 12.1 21C52 darwin-arm, locale en-GB)
    • Flutter version 2.11.0-0.0.pre.452 at /Users/mahesh/Documents/flutter_master
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision ba01ec8faa (4 days ago), 2022-02-05 22:05:18 -0500
    • Engine revision 0712096899
    • Dart version 2.17.0 (build 2.17.0-85.0.dev)
    • DevTools version 2.10.0

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/mahesh/Library/Android/sdk
    • Platform android-31, build-tools 31.0.0
    • ANDROID_HOME = /Users/mahesh/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.10.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • 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.8+10-b944.6916264)

[✓] IntelliJ IDEA Community Edition (version 2021.2.1)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 61.2.4
    • Dart plugin version 212.5080.8

[✓] VS Code (version 1.63.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.34.0

[✓] Connected device (3 available)
    • Redmi K20 Pro (mobile) • 192.168.1.2:5555 • android-arm64  • Android 11 (API 30)
    • macOS (desktop)        • macos            • darwin-arm64   • macOS 12.1 21C52 darwin-arm
    • Chrome (web)           • chrome           • web-javascript • Google Chrome 98.0.4758.80

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

I tried using the old version of Webview where the crash doesn't happen.

  video_player: ^2.2.18
  webview_flutter: ^2.1.2

This is unclear whether the error is due to webview or video_player
This seems like an issue with webview plugin as the same crash is reproducible with google maps + webview (#98182)

@maheshj01 maheshj01 added found in release: 2.10 Found to occur in 2.10 found in release: 2.11 Found to occur in 2.11 has reproducible steps The issue has been confirmed reproducible and is ready to work on p: first party p: video_player The Video Player plugin p: webview The WebView plugin c: regression It was better in the past than it is now platform-android Android applications specifically and removed in triage Presently being triaged by the triage team labels Feb 10, 2022
@maheshj01 maheshj01 added a: platform-views Embedding Android/iOS views in Flutter apps and removed p: video_player The Video Player plugin labels Feb 10, 2022
@maheshj01 maheshj01 changed the title [video_player][Android] App crashes after upgrading to 2.10.x and using webview plugin [Android] App crashes after upgrading to 2.10.x using webview + video_player plugin Feb 10, 2022
@iulian0512
Copy link

i have this crash when using google_maps_flutter + webview

@d3xt3r2909
Copy link
Author

Hi, @maheshmnj thanks for the quick response.

I would like just to mention that this is blocker (crasher) for upgrading the flutter version in our team.

Scenario:

  • we are using aggregated news that should be shown inside the ListView. This list is containing widgets from video player in one card and in another widget from webview

Follow up:

Same is happening with 3th party library youtube_player_iframe which is using different webview plugin - flutter_inappwebview. There is already opened issue in their repository which is very similar to this one and it also started to happen after upgrading to Flutter 2.10.x.

So I'm pretty sure that's connected more with upgrading the Flutter framework than webview plugin itself. (Just my observation)

@maheshj01
Copy link
Member

In case this is a blocker for anyone you may try downgrading the webview plugin to webview_flutter: ^2.1.2, I was unable to reproduce the crash there.

@d3xt3r2909
Copy link
Author

Ok, seems that issue is resolved based on your hint @maheshmnj

So webview_flutter had some breaking changes in 3.x.x

BREAKING CHANGE: On Android, hybrid composition (SurfaceAndroidWebView) is now the default. The previous default, virtual display, can be specified with WebView.platform = AndroidWebView()

And based on this #97283 (comment) you cannot have virtual displayes and hybrid composition together:

Virtual displays and hybrid composition don't work together. I'll keep this issue open since I'm working on eliminating this issue altogether.

Solution

So, based on this, if you are using webview plugin, you should enable virtual displays and disable hybrid composition, as video_player is obviously using virtual displays.

That means that actually by adding this part of code

    if (Platform.isAndroid) {
      WebView.platform = AndroidWebView();
    }

into the body of void initState() will enable virtual display (which were before 2.x.x of webview by default on)

Concern

  • If you are using video_player, you cannot use improvements for hybrid composition? (Should it be like that)
  • If one has used already a hybrid option for webview and video_player, this is causing crashes after upgrading to flutter 2.10.x and it's very likely that devs could publish to production users if they don't know about it.
  • I believe this could be documented better so that everyone are aware of it

Other plugins

  • 3th party - https://github.com/sarbagyastha/youtube_player_flutter have a bug with updating usage to hybrid composition (will open a ticket)
  • google maps - I'm not sure, as I'm not using it but I believe that it's also using virtual displays so you also need to disable hybrid composition and use virtual displays?

@iulian0512
Copy link

@d3xt3r2909 your solution works with gmaps, thanks.

@stuartmorgan
Copy link
Contributor

/cc @blasten

@stuartmorgan stuartmorgan added P1 High-priority issues at the top of the work list c: crash Stack traces logged to the console c: fatal crash Crashes that terminate the process labels Feb 10, 2022
@blasten blasten self-assigned this Feb 10, 2022
@blasten
Copy link

blasten commented Feb 11, 2022

This will be fixed by flutter/engine#31390.
This is one of missing integration test. I updated #97853 as well.

I think we should cherry pick the fix into Flutter 2.10.

@akilanfidelis
Copy link

In my case I have two pages one with the video player, other with a native ad.
If i switch from video player page to native ad and come back to video player it crashes.
If i comment out the native ad in that page, there is no crash in the app.

@github-actions
Copy link

github-actions bot commented Mar 8, 2022

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 8, 2022
@flutter-triage-bot flutter-triage-bot bot added the package flutter/packages repository. See also p: labels. label Jul 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: platform-views Embedding Android/iOS views in Flutter apps c: crash Stack traces logged to the console c: fatal crash Crashes that terminate the process c: regression It was better in the past than it is now found in release: 2.10 Found to occur in 2.10 found in release: 2.11 Found to occur in 2.11 has reproducible steps The issue has been confirmed reproducible and is ready to work on p: webview The WebView plugin P1 High-priority issues at the top of the work list package flutter/packages repository. See also p: labels. platform-android Android applications specifically r: fixed Issue is closed as already fixed in a newer version
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants