fijkplayer icon indicating copy to clipboard operation
fijkplayer copied to clipboard

[BUG]SurfaceTexture is already attached to a context

Open xzj524 opened this issue 3 years ago • 0 comments

Describe the bug SurfaceTexture is already attached to a context

What attempts have you made to resolve this error ? 在一个页面

To Reproduce 问题的复现步骤: 在一个页面的initState回调中使用 player.setDataSource(xxx, autoPlay: true); //xxx为本地文件路径 player.setLoop(0); 在打开页面的时候app崩溃,报如下错误: 2022-03-17 11:06:48.207 28800-28800/com.mi.car.mobile E/m.mi.car.mobil: [SurfaceTexture-0-28800-1] attachToContext: SurfaceTexture is already attached to a context 2022-03-17 11:06:48.208 28800-28800/com.mi.car.mobile E/flutter: [ERROR:flutter/fml/platform/android/jni_util.cc(211)] java.lang.RuntimeException: Error during attachToGLContext (see logcat for details) at android.graphics.SurfaceTexture.attachToGLContext(SurfaceTexture.java:295) at io.flutter.embedding.engine.renderer.SurfaceTextureWrapper.attachToGLContext(SurfaceTextureWrapper.java:57) at android.os.MessageQueue.nativePollOnce(Native Method) at android.os.MessageQueue.next(MessageQueue.java:335) at android.os.Looper.loop(Looper.java:190) at android.app.ActivityThread.main(ActivityThread.java:8052) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:656) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967) 2022-03-17 11:06:48.208 28800-28800/com.mi.car.mobile A/flutter: [FATAL:flutter/shell/platform/android/platform_view_android_jni_impl.cc(1301)] Check failed: fml::jni::CheckException(env). 2022-03-17 11:06:48.213 28800-28800/com.mi.car.mobile E/CRASH: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 2022-03-17 11:06:48.213 28800-28800/com.mi.car.mobile E/CRASH: Version '2021.2.13f1c1 (6b2322425690)', Build type 'Release', Scripting Backend 'il2cpp', CPU 'arm64-v8a' 2022-03-17 11:06:48.213 28800-28800/com.mi.car.mobile E/CRASH: Build fingerprint: 'Redmi/haydn/haydn:11/RKQ1.201112.002/V12.5.8.0.RKKCNXM:user/release-keys' 2022-03-17 11:06:48.213 28800-28800/com.mi.car.mobile E/CRASH: Revision: '0' 2022-03-17 11:06:48.213 28800-28800/com.mi.car.mobile E/CRASH: ABI: 'arm64' 2022-03-17 11:06:48.213 28800-28800/com.mi.car.mobile E/CRASH: Timestamp: 2022-03-17 11:06:48+0800 2022-03-17 11:06:48.213 28800-28800/com.mi.car.mobile E/CRASH: pid: 28800, tid: 28800, name: m.mi.car.mobile >>> com.mi.car.mobile <<< 2022-03-17 11:06:48.213 28800-28800/com.mi.car.mobile E/CRASH: uid: 10346 2022-03-17 11:06:48.213 28800-28800/com.mi.car.mobile E/CRASH: signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr -------- 2022-03-17 11:06:48.213 28800-28800/com.mi.car.mobile E/CRASH: x0 0000000000000000 x1 0000000000007080 x2 0000000000000006 x3 0000007fdbb0fe50 2022-03-17 11:06:48.213 28800-28800/com.mi.car.mobile E/CRASH: x4 6e70ff091f2d2875 x5 6e70ff091f2d2875 x6 6e70ff091f2d2875 x7 7f7f7f7f7f7f7f7f 2022-03-17 11:06:48.213 28800-28800/com.mi.car.mobile E/CRASH: x8 00000000000000f0 x9 85870ce5e4395daf x10 0000000000000000 x11 ffffffc0fffffbdf 2022-03-17 11:06:48.213 28800-28800/com.mi.car.mobile E/CRASH: x12 0000000000000001 x13 000000000000007e x14 000c2082c26da7b8 x15 0000000034155555 2022-03-17 11:06:48.213 28800-28800/com.mi.car.mobile E/CRASH: x16 0000007735cf9948 x17 0000007735cd8350 x18 0000000000000020 x19 0000000000007080 2022-03-17 11:06:48.213 28800-28800/com.mi.car.mobile E/CRASH: x20 0000000000007080 x21 00000000ffffffff x22 b4000076981b3b98 x23 b40000761e86fc28 2022-03-17 11:06:48.213 28800-28800/com.mi.car.mobile E/CRASH: x24 b40000769826a540 x25 0000000000000000 x26 0000000000000001 x27 0000000000000001 2022-03-17 11:06:48.213 28800-28800/com.mi.car.mobile E/CRASH: x28 000000000000004d x29 0000007fdbb0fed0 2022-03-17 11:06:48.213 28800-28800/com.mi.car.mobile E/CRASH: sp 0000007fdbb0fe30 lr 0000007735c8ba60 pc 0000007735c8ba8c 2022-03-17 11:06:48.213 28800-28800/com.mi.car.mobile E/CRASH: backtrace: 2022-03-17 11:06:48.213 28800-28800/com.mi.car.mobile E/CRASH: #00 pc 0000000000089a8c /apex/com.android.runtime/lib64/bionic/libc.so (abort+164) (BuildId: 5f57d25b37c043ed36c0e4147dcc8b3f) 2022-03-17 11:06:48.213 28800-28800/com.mi.car.mobile E/CRASH: #01 pc 0000000001509880 /data/app/~~XmqTzbnHq3UgkeZztS3uCQ==/com.mi.car.mobile-zqHS_FEWKzRZwYoLB3MDyw==/lib/arm64/libflutter.so (BuildId: 5650bb2df5ace86ba3c9913ef48b56eb77fbc72d) 2022-03-17 11:06:48.213 28800-28800/com.mi.car.mobile E/CRASH: #02 pc 000000000152b920 /data/app/~~XmqTzbnHq3UgkeZztS3uCQ==/com.mi.car.mobile-zqHS_FEWKzRZwYoLB3MDyw==/lib/arm64/libflutter.so (BuildId: 5650bb2df5ace86ba3c9913ef48b56eb77fbc72d) 2022-03-17 11:06:48.288 28800-32150/com.mi.car.mobile E/CRASH: other thread is trapped; signum = 6 2022-03-17 11:06:48.289 28800-32150/com.mi.car.mobile E/AndroidRuntime: FATAL EXCEPTION: UnityMain Process: com.mi.car.mobile, PID: 28800 java.lang.Error: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** Version '2021.2.13f1c1 (6b2322425690)', Build type 'Release', Scripting Backend 'il2cpp', CPU 'arm64-v8a' Build fingerprint: 'Redmi/haydn/haydn:11/RKQ1.201112.002/V12.5.8.0.RKKCNXM:user/release-keys' Revision: '0' ABI: 'arm64' Timestamp: 2022-03-17 11:06:48+0800 pid: 28800, tid: 28800, name: m.mi.car.mobile >>> com.mi.car.mobile <<< uid: 10346 signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr -------- x0 0000000000000000 x1 0000000000007080 x2 0000000000000006 x3 0000007fdbb0fe50 x4 6e70ff091f2d2875 x5 6e70ff091f2d2875 x6 6e70ff091f2d2875 x7 7f7f7f7f7f7f7f7f x8 00000000000000f0 x9 85870ce5e4395daf x10 0000000000000000 x11 ffffffc0fffffbdf x12 0000000000000001 x13 000000000000007e x14 000c2082c26da7b8 x15 0000000034155555 x16 0000007735cf9948 x17 0000007735cd8350 x18 0000000000000020 x19 0000000000007080 x20 0000000000007080 x21 00000000ffffffff x22 b4000076981b3b98 x23 b40000761e86fc28 x24 b40000769826a540 x25 0000000000000000 x26 0000000000000001 x27 0000000000000001 x28 000000000000004d x29 0000007fdbb0fed0 sp 0000007fdbb0fe30 lr 0000007735c8ba60 pc 0000007735c8ba8c

backtrace:
      #00 pc 0000000000089a8c  /apex/com.android.runtime/lib64/bionic/libc.so (abort+164) (BuildId: 5f57d25b37c043ed36c0e4147dcc8b3f)
      #01 pc 0000000001509880  /data/app/~~XmqTzbnHq3UgkeZztS3uCQ==/com.mi.car.mobile-zqHS_FEWKzRZwYoLB3MDyw==/lib/arm64/libflutter.so (BuildId: 5650bb2df5ace86ba3c9913ef48b56eb77fbc72d)
      #02 pc 000000000152b920  /data/app/~~XmqTzbnHq3UgkeZztS3uCQ==/com.mi.car.mobile-zqHS_FEWKzRZwYoLB3MDyw==/lib/arm64/libflutter.so (BuildId: 5650bb2df5ace86ba3c9913ef48b56eb77fbc72d)

    at libc.abort(abort:164)
    at libflutter.0x1509880(Native Method)
    at libflutter.0x152b920(Native Method)

2022-03-17 11:06:48.298 28800-32150/com.mi.car.mobile E/ApplicationCrashHandler: uncaughtException java.lang.Error: FATAL EXCEPTION [UnityMain] Unity version : 2021.2.13f1c1 Device model : Xiaomi M2012K11C Device fingerprint: Redmi/haydn/haydn:11/RKQ1.201112.002/V12.5.8.0.RKKCNXM:user/release-keys Build Type : Release Scripting Backend : IL2CPP ABI : arm64-v8a Strip Engine Code : true

Caused by: java.lang.Error: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Version '2021.2.13f1c1 (6b2322425690)', Build type 'Release', Scripting Backend 'il2cpp', CPU 'arm64-v8a'
Build fingerprint: 'Redmi/haydn/haydn:11/RKQ1.201112.002/V12.5.8.0.RKKCNXM:user/release-keys'
Revision: '0'
ABI: 'arm64'
Timestamp: 2022-03-17 11:06:48+0800
pid: 28800, tid: 28800, name: m.mi.car.mobile  >>> com.mi.car.mobile <<<
uid: 10346
signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
    x0  0000000000000000  x1  0000000000007080  x2  0000000000000006  x3  0000007fdbb0fe50
    x4  6e70ff091f2d2875  x5  6e70ff091f2d2875  x6  6e70ff091f2d2875  x7  7f7f7f7f7f7f7f7f
    x8  00000000000000f0  x9  85870ce5e4395daf  x10 0000000000000000  x11 ffffffc0fffffbdf
    x12 0000000000000001  x13 000000000000007e  x14 000c2082c26da7b8  x15 0000000034155555
    x16 0000007735cf9948  x17 0000007735cd8350  x18 0000000000000020  x19 0000000000007080
    x20 0000000000007080  x21 00000000ffffffff  x22 b4000076981b3b98  x23 b40000761e86fc28
    x24 b40000769826a540  x25 0000000000000000  x26 0000000000000001  x27 0000000000000001
    x28 000000000000004d  x29 0000007fdbb0fed0
    sp  0000007fdbb0fe30  lr  0000007735c8ba60  pc  0000007735c8ba8c

backtrace:
      #00 pc 0000000000089a8c  /apex/com.android.runtime/lib64/bionic/libc.so (abort+164) (BuildId: 5f57d25b37c043ed36c0e4147dcc8b3f)
      #01 pc 0000000001509880  /data/app/~~XmqTzbnHq3UgkeZztS3uCQ==/com.mi.car.mobile-zqHS_FEWKzRZwYoLB3MDyw==/lib/arm64/libflutter.so (BuildId: 5650bb2df5ace86ba3c9913ef48b56eb77fbc72d)
      #02 pc 000000000152b920  /data/app/~~XmqTzbnHq3UgkeZztS3uCQ==/com.mi.car.mobile-zqHS_FEWKzRZwYoLB3MDyw==/lib/arm64/libflutter.so (BuildId: 5650bb2df5ace86ba3c9913ef48b56eb77fbc72d)

    at libc.abort(abort:164)
    at libflutter.0x1509880(Native Method)
    at libflutter.0x152b920(Native Method)

Expected behavior A clear and concise description of what you expected to happen. 描述清楚你希望的运行结果是什么 正确打开视频文件,正常播放

Screenshots If applicable, add screenshots to help explain your problem. 如果截图有助于对此问题的理解,一定要附上截图

fijkplayer version Which version you used. 用了什么版本的 fijkplayer fijkplayer: ^0.10.1

Smartphone (please complete the following information): 什么手机设备和系统版本?

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • 红米K40, miui 12.5.8

Additional context Add any other context about the problem here. 其他有关此问题的内容

xzj524 avatar Mar 17 '22 03:03 xzj524