mobile_scanner icon indicating copy to clipboard operation
mobile_scanner copied to clipboard

APP crashes when I turn on debug or profile mode

Open zhangstar666 opened this issue 2 years ago • 15 comments

APP crashes when I turn on debug or profile mode.

Version: mobile_scanner:0.2.0 flutter:2.10.3 And 2.8.1 (Both versions 2.10.3 and 2.8.1 have appeared, and other Flutter versions have not been tested yet.)

My Code :

import 'package:flutter/material.dart';
import 'package:miffy_tuya_smart_sdk_example/component/MiffyScreen.dart';
import 'package:mobile_scanner/mobile_scanner.dart';

class Scan extends StatelessWidget {
  final MobileScannerController _controller =
      MobileScannerController(torchEnabled: false);
  @override
  Widget build(BuildContext context) {
    return ConstrainedBox(
        constraints: const BoxConstraints.expand(),
        child: Stack(
          alignment: Alignment.topCenter,
          children: [
            MobileScanner(
                controller: _controller,
                onDetect: (barcode, args) {
                  final String? code = barcode.rawValue;
                  debugPrint('Barcode found! $code');
                  _controller.dispose();
                  Navigator.pop(context);
                }),
          ],
        ));
  }
}

Crash Log:

D/ViewRootImpl( 9140): enqueueInputEventMotionEvent { action=ACTION_DOWN, actionButton=0, id[0]=0, x[0]=568.0, y[0]=2323.0, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=1082620301, downTime=1082620301, deviceId=3, source=0x1002, displayId=0 }
D/ViewRootImpl[MainActivity]( 9140): processMotionEvent MotionEvent { action=ACTION_DOWN, actionButton=0, id[0]=0, x[0]=568.0, y[0]=2323.0, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=1082620301, downTime=1082620301, deviceId=3, source=0x1002, displayId=0 }
D/ViewRootImpl[MainActivity]( 9140): dispatchPointerEvent handled=true, event=MotionEvent { action=ACTION_DOWN, actionButton=0, id[0]=0, x[0]=568.0, y[0]=2323.0, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=1082620301, downTime=1082620301, deviceId=3, source=0x1002, displayId=0 }
D/ViewRootImpl[MainActivity]( 9140): processMotionEvent MotionEvent { action=ACTION_UP, actionButton=0, id[0]=0, x[0]=568.0, y[0]=2323.0, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=1082620342, downTime=1082620301, deviceId=3, source=0x1002, displayId=0 }
D/ViewRootImpl[MainActivity]( 9140): dispatchPointerEvent handled=true, event=MotionEvent { action=ACTION_UP, actionButton=0, id[0]=0, x[0]=568.0, y[0]=2323.0, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=1082620342, downTime=1082620301, deviceId=3, source=0x1002, displayId=0 }
I/OplusCameraManager( 9140): saveOpPackageName, mOpPackageName: com.smart.happy
I/OplusCameraManagerGlobal( 9140): setClientInfo, packageName: com.smart.happy, uid: 10392, pid: 9140
I/OplusCameraManagerGlobal( 9140): Connecting to camera service
I/CameraManagerGlobal( 9140): Connecting to camera service
E/libc    ( 9140): Access denied finding property "vendor.camera.aux.packagelist"
I/chatty  ( 9140): uid=10392(com.smart.happy) CameraX-core_ca identical 1 line
E/libc    ( 9140): Access denied finding property "vendor.camera.aux.packagelist"
E/libc    ( 9140): Access denied finding property "vendor.camera.aux.packagelist"
E/libc    ( 9140): Access denied finding property "vendor.camera.aux.packagelist"
W/CameraManagerGlobal( 9140): ignore the torch status update of camera: 2
E/libc    ( 9140): Access denied finding property "vendor.camera.aux.packagelist"
W/CameraManagerGlobal( 9140): ignore the torch status update of camera: 3
E/libc    ( 9140): Access denied finding property "vendor.camera.aux.packagelist"
W/CameraManagerGlobal( 9140): ignore the torch status update of camera: 4
I/OplusCameraManagerGlobal( 9140): setClientInfo, packageName: com.smart.happy, uid: 10392, pid: 9140
I/chatty  ( 9140): uid=10392(com.smart.happy) CameraX-core_ca identical 4 lines
I/OplusCameraManagerGlobal( 9140): setClientInfo, packageName: com.smart.happy, uid: 10392, pid: 9140
D/CameraRepository( 9140): Added camera: 0
I/Camera2CameraInfo( 9140): Device Level: INFO_SUPPORTED_HARDWARE_LEVEL_3
I/OplusCameraManagerGlobal( 9140): setClientInfo, packageName: com.smart.happy, uid: 10392, pid: 9140
D/CameraRepository( 9140): Added camera: 1
I/Camera2CameraInfo( 9140): Device Level: INFO_SUPPORTED_HARDWARE_LEVEL_3
I/OplusCameraManagerGlobal( 9140): setClientInfo, packageName: com.smart.happy, uid: 10392, pid: 9140
D/CameraValidator( 9140): Verifying camera lens facing on RMX3161CN, lensFacingInteger: null
D/DeferrableSurface( 9140): Surface created[total_surfaces=1, used_surfaces=0](androidx.camera.core.SurfaceRequest$2@5331dae}
D/CameraOrientationUtil( 9140): getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=90, isOppositeFacing=true, result=90
I/chatty  ( 9140): uid=10392(com.smart.happy) identical 1 line
D/CameraOrientationUtil( 9140): getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=90, isOppositeFacing=true, result=90
D/DeferrableSurface( 9140): Surface created[total_surfaces=2, used_surfaces=0](androidx.camera.core.impl.ImmediateSurface@be9ebe5}
D/Camera2CameraImpl( 9140): {Camera@4acbb13[id=0]} Use case androidx.camera.core.Preview-96105928-e476-4b12-a90d-e1b4453c95fb38840790 ACTIVE
D/CameraOrientationUtil( 9140): getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=90, isOppositeFacing=true, result=90
D/UseCaseAttachState( 9140): Active and attached use case: [] for camera: 0
D/CameraOrientationUtil( 9140): getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=90, isOppositeFacing=true, result=90
I/LOG     ( 9140): Analyzer: 640x480
I/LOG     ( 9140): Preview: 1600x1200
D/CameraOrientationUtil( 9140): getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=90, isOppositeFacing=true, result=90
D/CameraOrientationUtil( 9140): getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=90, isOppositeFacing=true, result=90
D/Camera2CameraImpl( 9140): {Camera@4acbb13[id=0]} Use case androidx.camera.core.ImageAnalysis-ffe93fde-7004-46d4-970a-a221c124a63926981463 ACTIVE
D/UseCaseAttachState( 9140): Active and attached use case: [] for camera: 0
D/Camera2CameraImpl( 9140): {Camera@4acbb13[id=0]} Use cases [androidx.camera.core.Preview-96105928-e476-4b12-a90d-e1b4453c95fb38840790, androidx.camera.core.ImageAnalysis-ffe93fde-7004-46d4-970a-a221c124a63926981463] now ATTACHED
D/UseCaseAttachState( 9140): All use case: [androidx.camera.core.Preview-96105928-e476-4b12-a90d-e1b4453c95fb38840790, androidx.camera.core.ImageAnalysis-ffe93fde-7004-46d4-970a-a221c124a63926981463] for camera: 0
D/UseCaseAttachState( 9140): Active and attached use case: [androidx.camera.core.Preview-96105928-e476-4b12-a90d-e1b4453c95fb38840790, androidx.camera.core.ImageAnalysis-ffe93fde-7004-46d4-970a-a221c124a63926981463] for camera: 0
E/com.smart.happ( 9140): [SurfaceTexture-0-9140-0] attachToContext: invalid current EGLDisplay
E/flutter ( 9140): [ERROR:flutter/fml/platform/android/jni_util.cc(211)] java.lang.RuntimeException: Error during attachToGLContext (see logcat for details)
E/flutter ( 9140): 	at android.graphics.SurfaceTexture.attachToGLContext(SurfaceTexture.java:295)
E/flutter ( 9140): 	at io.flutter.embedding.engine.renderer.SurfaceTextureWrapper.attachToGLContext(SurfaceTextureWrapper.java:71)
E/flutter ( 9140):
F/flutter ( 9140): [FATAL:flutter/shell/platform/android/platform_view_android_jni_impl.cc(1301)] Check failed: fml::jni::CheckException(env).
F/libc    ( 9140): Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 9237 (1.raster), pid 9140 (com.smart.happy)
Process name is com.smart.happy, not key_process
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'realme/RMX3161/RMX3161CN:11/RKQ1.201217.002/1639934812003:user/release-keys'
Revision: '0'
ABI: 'arm64'
Timestamp: 2022-03-08 15:55:47+0800
pid: 9140, tid: 9237, name: 1.raster  >>> com.smart.happy <<<
uid: 10392
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  0000000000002415  x2  0000000000000006  x3  0000007034e4ab00
    x4  fefeff091f2d2875  x5  fefeff091f2d2875  x6  fefeff091f2d2875  x7  7f7f7f7f7f7f7f7f
    x8  00000000000000f0  x9  8b59b306532be312  x10 0000000000000000  x11 ffffffc0fffffbdf
    x12 0000000000000001  x13 000000000000007e  x14 000c656d2705769f  x15 0000000034155555
    x16 000000712ace87e0  x17 000000712acc7da0  x18 000000702ff94000  x19 00000000000023b4
    x20 0000000000002415  x21 00000000ffffffff  x22 b400007087fd3518  x23 b4000070190cc0e8
    x24 0000000000000000  x25 0000000000000000  x26 0000000000000000  x27 b400007087e41f58
    x28 0000000000000001  x29 0000007034e4ab80
    lr  000000712ac7b460  sp  0000007034e4aae0  pc  000000712ac7b48c  pst 0000000000001000
backtrace:
      #00 pc 000000000007848c  /apex/com.android.runtime/lib64/bionic/libc.so (abort+164) (BuildId: e81bf516b888e895d4e757da439c8117)
      #01 pc 00000000006aae14  /data/app/~~pqTss0DWkbeEv6LjNlQ-oQ==/com.smart.happy-IxCucnU6giwbnd-6MigAZw==/lib/arm64/libflutter.so (BuildId: 3ff4e11779799bd3186efb7b5dc7e19692fe982e)
      #02 pc 00000000006cef94  /data/app/~~pqTss0DWkbeEv6LjNlQ-oQ==/com.smart.happy-IxCucnU6giwbnd-6MigAZw==/lib/arm64/libflutter.so (BuildId: 3ff4e11779799bd3186efb7b5dc7e19692fe982e)
      #03 pc 00000000006bde3c  /data/app/~~pqTss0DWkbeEv6LjNlQ-oQ==/com.smart.happy-IxCucnU6giwbnd-6MigAZw==/lib/arm64/libflutter.so (BuildId: 3ff4e11779799bd3186efb7b5dc7e19692fe982e)
      #04 pc 00000000006abfc4  /data/app/~~pqTss0DWkbeEv6LjNlQ-oQ==/com.smart.happy-IxCucnU6giwbnd-6MigAZw==/lib/arm64/libflutter.so (BuildId: 3ff4e11779799bd3186efb7b5dc7e19692fe982e)
      #05 pc 00000000009138bc  /data/app/~~pqTss0DWkbeEv6LjNlQ-oQ==/com.smart.happy-IxCucnU6giwbnd-6MigAZw==/lib/arm64/libflutter.so (BuildId: 3ff4e11779799bd3186efb7b5dc7e19692fe982e)
      #06 pc 0000000000910518  /data/app/~~pqTss0DWkbeEv6LjNlQ-oQ==/com.smart.happy-IxCucnU6giwbnd-6MigAZw==/lib/arm64/libflutter.so (BuildId: 3ff4e11779799bd3186efb7b5dc7e19692fe982e)
      #07 pc 0000000000913a88  /data/app/~~pqTss0DWkbeEv6LjNlQ-oQ==/com.smart.happy-IxCucnU6giwbnd-6MigAZw==/lib/arm64/libflutter.so (BuildId: 3ff4e11779799bd3186efb7b5dc7e19692fe982e)
      #08 pc 0000000000910518  /data/app/~~pqTss0DWkbeEv6LjNlQ-oQ==/com.smart.happy-IxCucnU6giwbnd-6MigAZw==/lib/arm64/libflutter.so (BuildId: 3ff4e11779799bd3186efb7b5dc7e19692fe982e)
      #09 pc 0000000000913a88  /data/app/~~pqTss0DWkbeEv6LjNlQ-oQ==/com.smart.happy-IxCucnU6giwbnd-6MigAZw==/lib/arm64/libflutter.so (BuildId: 3ff4e11779799bd3186efb7b5dc7e19692fe982e)
      #10 pc 0000000000910518  /data/app/~~pqTss0DWkbeEv6LjNlQ-oQ==/com.smart.happy-IxCucnU6giwbnd-6MigAZw==/lib/arm64/libflutter.so (BuildId: 3ff4e11779799bd3186efb7b5dc7e19692fe982e)
      #11 pc 000000000090faa8  /data/app/~~pqTss0DWkbeEv6LjNlQ-oQ==/com.smart.happy-IxCucnU6giwbnd-6MigAZw==/lib/arm64/libflutter.so (BuildId: 3ff4e11779799bd3186efb7b5dc7e19692fe982e)
      #12 pc 0000000000910518  /data/app/~~pqTss0DWkbeEv6LjNlQ-oQ==/com.smart.happy-IxCucnU6giwbnd-6MigAZw==/lib/arm64/libflutter.so (BuildId: 3ff4e11779799bd3186efb7b5dc7e19692fe982e)
      #13 pc 0000000000913a88  /data/app/~~pqTss0DWkbeEv6LjNlQ-oQ==/com.smart.happy-IxCucnU6giwbnd-6MigAZw==/lib/arm64/libflutter.so (BuildId: 3ff4e11779799bd3186efb7b5dc7e19692fe982e)
      #14 pc 0000000000910518  /data/app/~~pqTss0DWkbeEv6LjNlQ-oQ==/com.smart.happy-IxCucnU6giwbnd-6MigAZw==/lib/arm64/libflutter.so (BuildId: 3ff4e11779799bd3186efb7b5dc7e19692fe982e)
      #15 pc 0000000000913a88  /data/app/~~pqTss0DWkbeEv6LjNlQ-oQ==/com.smart.happy-IxCucnU6giwbnd-6MigAZw==/lib/arm64/libflutter.so (BuildId: 3ff4e11779799bd3186efb7b5dc7e19692fe982e)
      #16 pc 0000000000910518  /data/app/~~pqTss0DWkbeEv6LjNlQ-oQ==/com.smart.happy-IxCucnU6giwbnd-6MigAZw==/lib/arm64/libflutter.so (BuildId: 3ff4e11779799bd3186efb7b5dc7e19692fe982e)
      #17 pc 0000000000912d74  /data/app/~~pqTss0DWkbeEv6LjNlQ-oQ==/com.smart.happy-IxCucnU6giwbnd-6MigAZw==/lib/arm64/libflutter.so (BuildId: 3ff4e11779799bd3186efb7b5dc7e19692fe982e)
      #18 pc 0000000000910518  /data/app/~~pqTss0DWkbeEv6LjNlQ-oQ==/com.smart.happy-IxCucnU6giwbnd-6MigAZw==/lib/arm64/libflutter.so (BuildId: 3ff4e11779799bd3186efb7b5dc7e19692fe982e)
      #19 pc 0000000000913a88  /data/app/~~pqTss0DWkbeEv6LjNlQ-oQ==/com.smart.happy-IxCucnU6giwbnd-6MigAZw==/lib/arm64/libflutter.so (BuildId: 3ff4e11779799bd3186efb7b5dc7e19692fe982e)
      #20 pc 0000000000910518  /data/app/~~pqTss0DWkbeEv6LjNlQ-oQ==/com.smart.happy-IxCucnU6giwbnd-6MigAZw==/lib/arm64/libflutter.so (BuildId: 3ff4e11779799bd3186efb7b5dc7e19692fe982e)
      #21 pc 000000000090e6f0  /data/app/~~pqTss0DWkbeEv6LjNlQ-oQ==/com.smart.happy-IxCucnU6giwbnd-6MigAZw==/lib/arm64/libflutter.so (BuildId: 3ff4e11779799bd3186efb7b5dc7e19692fe982e)
      #22 pc 00000000009201b8  /data/app/~~pqTss0DWkbeEv6LjNlQ-oQ==/com.smart.happy-IxCucnU6giwbnd-6MigAZw==/lib/arm64/libflutter.so (BuildId: 3ff4e11779799bd3186efb7b5dc7e19692fe982e)
      #23 pc 000000000091febc  /data/app/~~pqTss0DWkbeEv6LjNlQ-oQ==/com.smart.happy-IxCucnU6giwbnd-6MigAZw==/lib/arm64/libflutter.so (BuildId: 3ff4e11779799bd3186efb7b5dc7e19692fe982e)
      #24 pc 00000000009210b0  /data/app/~~pqTss0DWkbeEv6LjNlQ-oQ==/com.smart.happy-IxCucnU6giwbnd-6MigAZw==/lib/arm64/libflutter.so (BuildId: 3ff4e11779799bd3186efb7b5dc7e19692fe982e)
      #25 pc 0000000000920ad4  /data/app/~~pqTss0DWkbeEv6LjNlQ-oQ==/com.smart.happy-IxCucnU6giwbnd-6MigAZw==/lib/arm64/libflutter.so (BuildId: 3ff4e11779799bd3186efb7b5dc7e19692fe982e)
      #26 pc 000000000092928c  /data/app/~~pqTss0DWkbeEv6LjNlQ-oQ==/com.smart.happy-IxCucnU6giwbnd-6MigAZw==/lib/arm64/libflutter.so (BuildId: 3ff4e11779799bd3186efb7b5dc7e19692fe982e)
      #27 pc 00000000006cfbc0  /data/app/~~pqTss0DWkbeEv6LjNlQ-oQ==/com.smart.happy-IxCucnU6giwbnd-6MigAZw==/lib/arm64/libflutter.so (BuildId: 3ff4e11779799bd3186efb7b5dc7e19692fe982e)
      #28 pc 00000000006d34c4  /data/app/~~pqTss0DWkbeEv6LjNlQ-oQ==/com.smart.happy-IxCucnU6giwbnd-6MigAZw==/lib/arm64/libflutter.so (BuildId: 3ff4e11779799bd3186efb7b5dc7e19692fe982e)
      #29 pc 0000000000019da8  /system/lib64/libutils.so (android::Looper::pollInner(int)+916) (BuildId: 85aad54dcf3341150498b846bfca7931)
      #30 pc 00000000000199ac  /system/lib64/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+112) (BuildId: 85aad54dcf3341150498b846bfca7931)
      #31 pc 0000000000012c74  /system/lib64/libandroid.so (ALooper_pollOnce+100) (BuildId: 35fcec94a508276f883368d9eaad1c96)
      #32 pc 00000000006d35d4  /data/app/~~pqTss0DWkbeEv6LjNlQ-oQ==/com.smart.happy-IxCucnU6giwbnd-6MigAZw==/lib/arm64/libflutter.so (BuildId: 3ff4e11779799bd3186efb7b5dc7e19692fe982e)
      #33 pc 00000000006d1890  /data/app/~~pqTss0DWkbeEv6LjNlQ-oQ==/com.smart.happy-IxCucnU6giwbnd-6MigAZw==/lib/arm64/libflutter.so (BuildId: 3ff4e11779799bd3186efb7b5dc7e19692fe982e)
      #34 pc 00000000000da278  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+64) (BuildId: e81bf516b888e895d4e757da439c8117)
      #35 pc 000000000007a448  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: e81bf516b888e895d4e757da439c8117)
Lost connection to device.
Exited (sigterm)

zhangstar666 avatar Mar 08 '22 08:03 zhangstar666

Which device are you using?

juliansteenbakker avatar Mar 08 '22 19:03 juliansteenbakker

Which device are you using?

45e01c6f44bd92dd9d440c6c3bb3912

zhangstar666 avatar Mar 09 '22 12:03 zhangstar666

Thank you for fixing the problem I reported.

I used the latest version 1.0.0.The same problem will still arise.(debug mode) What is the cause of this kind of carsh?

Crash Log:


I/OplusCameraManagerGlobal(12393): setClientInfo, packageName: com.smart.happy, uid: 10392, pid: 12393
D/CameraRepository(12393): Added camera: 0
I/Camera2CameraInfo(12393): Device Level: INFO_SUPPORTED_HARDWARE_LEVEL_3
I/OplusCameraManagerGlobal(12393): setClientInfo, packageName: com.smart.happy, uid: 10392, pid: 12393
D/CameraRepository(12393): Added camera: 1
I/Camera2CameraInfo(12393): Device Level: INFO_SUPPORTED_HARDWARE_LEVEL_3
I/OplusCameraManagerGlobal(12393): setClientInfo, packageName: com.smart.happy, uid: 10392, pid: 12393
D/CameraValidator(12393): Verifying camera lens facing on RMX3161CN, lensFacingInteger: null
D/DeferrableSurface(12393): Surface created[total_surfaces=1, used_surfaces=0](androidx.camera.core.SurfaceRequest$2@632488}
D/CameraOrientationUtil(12393): getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=90, isOppositeFacing=true, result=90
I/chatty  (12393): uid=10392(com.smart.happy) identical 1 line
D/CameraOrientationUtil(12393): getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=90, isOppositeFacing=true, result=90
D/DeferrableSurface(12393): Surface created[total_surfaces=2, used_surfaces=0](androidx.camera.core.impl.ImmediateSurface@258dc07}
D/Camera2CameraImpl(12393): {Camera@46bae3c[id=0]} Use case androidx.camera.core.Preview-c9a63912-d61a-44a1-bdac-f6382e662d39217044848 ACTIVE
D/CameraOrientationUtil(12393): getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=90, isOppositeFacing=true, result=90
D/UseCaseAttachState(12393): Active and attached use case: [] for camera: 0
D/CameraOrientationUtil(12393): getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=90, isOppositeFacing=true, result=90
I/LOG     (12393): Analyzer: 640x480
I/LOG     (12393): Preview: 1600x1200
D/Camera2CameraImpl(12393): {Camera@46bae3c[id=0]} Use case androidx.camera.core.ImageAnalysis-e72a31f4-c55b-4556-9b32-aa71b07c45e4107154153 ACTIVE
D/UseCaseAttachState(12393): Active and attached use case: [] for camera: 0
D/CameraOrientationUtil(12393): getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=90, isOppositeFacing=true, result=90
D/CameraOrientationUtil(12393): getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=90, isOppositeFacing=true, result=90
D/Camera2CameraImpl(12393): {Camera@46bae3c[id=0]} Use cases [androidx.camera.core.Preview-c9a63912-d61a-44a1-bdac-f6382e662d39217044848, androidx.camera.core.ImageAnalysis-e72a31f4-c55b-4556-9b32-aa71b07c45e4107154153] now ATTACHED
D/UseCaseAttachState(12393): All use case: [androidx.camera.core.Preview-c9a63912-d61a-44a1-bdac-f6382e662d39217044848, androidx.camera.core.ImageAnalysis-e72a31f4-c55b-4556-9b32-aa71b07c45e4107154153] for camera: 0
D/UseCaseAttachState(12393): Active and attached use case: [androidx.camera.core.Preview-c9a63912-d61a-44a1-bdac-f6382e662d39217044848, androidx.camera.core.ImageAnalysis-e72a31f4-c55b-4556-9b32-aa71b07c45e4107154153] for camera: 0
D/Camera2CameraImpl(12393): {Camera@46bae3c[id=0]} Resetting Capture Session
D/Camera2CameraImpl(12393): {Camera@46bae3c[id=0]} Releasing session in state INITIALIZED
D/Camera2CameraImpl(12393): {Camera@46bae3c[id=0]} Attempting to force open the camera.
D/CameraStateRegistry(12393): tryOpenCamera(Camera@46bae3c[id=0]) [Available Cameras: 1, Already Open: false (Previous state: null)] --> SUCCESS
D/CameraStateRegistry(12393): Recalculating open cameras:
D/CameraStateRegistry(12393): Camera                                       State
D/CameraStateRegistry(12393): -------------------------------------------------------------------
D/CameraStateRegistry(12393): Camera@4b13e27[id=1]                         UNKNOWN
D/CameraStateRegistry(12393): Camera@46bae3c[id=0]                         OPENING
D/CameraStateRegistry(12393): -------------------------------------------------------------------
D/CameraStateRegistry(12393): Open count: 1 (Max allowed: 1)
D/Camera2CameraImpl(12393): {Camera@46bae3c[id=0]} Opening camera.
D/Camera2CameraImpl(12393): {Camera@46bae3c[id=0]} Transitioning camera internal state: INITIALIZED --> OPENING
D/CameraStateMachine(12393): New public camera state CameraState{type=OPENING, error=null} from OPENING and null
D/CameraStateMachine(12393): Publishing new public camera state CameraState{type=OPENING, error=null}
D/UseCaseAttachState(12393): All use case: [androidx.camera.core.Preview-c9a63912-d61a-44a1-bdac-f6382e662d39217044848, androidx.camera.core.ImageAnalysis-e72a31f4-c55b-4556-9b32-aa71b07c45e4107154153] for camera: 0
I/OplusCameraManagerGlobal(12393): setClientInfo, packageName: com.smart.happy, uid: 10392, pid: 12393
I/chatty  (12393): uid=10392(com.smart.happy) CameraX-core_ca identical 1 line
I/OplusCameraManagerGlobal(12393): setClientInfo, packageName: com.smart.happy, uid: 10392, pid: 12393
E/libc    (12393): Access denied finding property "persist.vendor.camera.privapp.list"
I/OplusCameraManagerGlobal(12393): setClientInfo, packageName: com.smart.happy, uid: 10392, pid: 12393
I/OplusCameraManagerGlobal(12393): setClientInfo, packageName: com.smart.happy, uid: 10392, pid: 12393
E/com.smart.happ(12393): [SurfaceTexture-0-12393-0] attachToContext: invalid current EGLDisplay
E/flutter (12393): [ERROR:flutter/fml/platform/android/jni_util.cc(211)] java.lang.RuntimeException: Error during attachToGLContext (see logcat for details)
E/flutter (12393): 	at android.graphics.SurfaceTexture.attachToGLContext(SurfaceTexture.java:295)
E/flutter (12393): 	at io.flutter.embedding.engine.renderer.SurfaceTextureWrapper.attachToGLContext(SurfaceTextureWrapper.java:71)
E/flutter (12393):
F/flutter (12393): [FATAL:flutter/shell/platform/android/platform_view_android_jni_impl.cc(1301)] Check failed: fml::jni::CheckException(env).
F/libc    (12393): Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 12426 (1.raster), pid 12393 (com.smart.happy)
Process name is com.smart.happy, not key_process
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'realme/RMX3161/RMX3161CN:11/RKQ1.201217.002/1639934812003:user/release-keys'
Revision: '0'
ABI: 'arm64'
Timestamp: 2022-03-14 14:42:19+0800
pid: 12393, tid: 12426, name: 1.raster  >>> com.smart.happy <<<
uid: 10392
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  000000000000308a  x2  0000000000000006  x3  000000702e7c3e30
    x4  fefeff091f2d2875  x5  fefeff091f2d2875  x6  fefeff091f2d2875  x7  7f7f7f7f7f7f7f7f
    x8  00000000000000f0  x9  8b59b306532be312  x10 0000000000000000  x11 ffffffc0fffffbdf
    x12 0000000000000001  x13 000000000000007e  x14 001e1676c67b75bb  x15 0000000034155555
    x16 000000712ace87e0  x17 000000712acc7da0  x18 000000702dbf0000  x19 0000000000003069
    x20 000000000000308a  x21 00000000ffffffff  x22 b400007034b5d398  x23 b400007034b02e48
    x24 0000000000000000  x25 0000000000000000  x26 0000000000000001  x27 0000000000000001
    x28 0000000000000057  x29 000000702e7c3eb0
    lr  000000712ac7b460  sp  000000702e7c3e10  pc  000000712ac7b48c  pst 0000000000001000
backtrace:
      #00 pc 000000000007848c  /apex/com.android.runtime/lib64/bionic/libc.so (abort+164) (BuildId: e81bf516b888e895d4e757da439c8117)
      #01 pc 000000000150a840  /data/app/~~44qBkY7NsjbVg_5Tg6ehCQ==/com.smart.happy-uiKspjljazPUIOGbYj5s4w==/lib/arm64/libflutter.so (BuildId: 15510187a6240786a32bdde8747cec6c0f6dcae3)
      #02 pc 000000000152c8e0  /data/app/~~44qBkY7NsjbVg_5Tg6ehCQ==/com.smart.happy-uiKspjljazPUIOGbYj5s4w==/lib/arm64/libflutter.so (BuildId: 15510187a6240786a32bdde8747cec6c0f6dcae3)
      #03 pc 0000000001513828  /data/app/~~44qBkY7NsjbVg_5Tg6ehCQ==/com.smart.happy-uiKspjljazPUIOGbYj5s4w==/lib/arm64/libflutter.so (BuildId: 15510187a6240786a32bdde8747cec6c0f6dcae3)
      #04 pc 00000000015096dc  /data/app/~~44qBkY7NsjbVg_5Tg6ehCQ==/com.smart.happy-uiKspjljazPUIOGbYj5s4w==/lib/arm64/libflutter.so (BuildId: 15510187a6240786a32bdde8747cec6c0f6dcae3)
      #05 pc 000000000150954c  /data/app/~~44qBkY7NsjbVg_5Tg6ehCQ==/com.smart.happy-uiKspjljazPUIOGbYj5s4w==/lib/arm64/libflutter.so (BuildId: 15510187a6240786a32bdde8747cec6c0f6dcae3)
      #06 pc 000000000182cfc4  /data/app/~~44qBkY7NsjbVg_5Tg6ehCQ==/com.smart.happy-uiKspjljazPUIOGbYj5s4w==/lib/arm64/libflutter.so (BuildId: 15510187a6240786a32bdde8747cec6c0f6dcae3)
      #07 pc 0000000001829bc4  /data/app/~~44qBkY7NsjbVg_5Tg6ehCQ==/com.smart.happy-uiKspjljazPUIOGbYj5s4w==/lib/arm64/libflutter.so (BuildId: 15510187a6240786a32bdde8747cec6c0f6dcae3)
      #08 pc 000000000182d320  /data/app/~~44qBkY7NsjbVg_5Tg6ehCQ==/com.smart.happy-uiKspjljazPUIOGbYj5s4w==/lib/arm64/libflutter.so (BuildId: 15510187a6240786a32bdde8747cec6c0f6dcae3)
      #09 pc 0000000001829bc4  /data/app/~~44qBkY7NsjbVg_5Tg6ehCQ==/com.smart.happy-uiKspjljazPUIOGbYj5s4w==/lib/arm64/libflutter.so (BuildId: 15510187a6240786a32bdde8747cec6c0f6dcae3)
      #10 pc 000000000182d320  /data/app/~~44qBkY7NsjbVg_5Tg6ehCQ==/com.smart.happy-uiKspjljazPUIOGbYj5s4w==/lib/arm64/libflutter.so (BuildId: 15510187a6240786a32bdde8747cec6c0f6dcae3)
      #11 pc 0000000001829bc4  /data/app/~~44qBkY7NsjbVg_5Tg6ehCQ==/com.smart.happy-uiKspjljazPUIOGbYj5s4w==/lib/arm64/libflutter.so (BuildId: 15510187a6240786a32bdde8747cec6c0f6dcae3)
      #12 pc 0000000001828f70  /data/app/~~44qBkY7NsjbVg_5Tg6ehCQ==/com.smart.happy-uiKspjljazPUIOGbYj5s4w==/lib/arm64/libflutter.so (BuildId: 15510187a6240786a32bdde8747cec6c0f6dcae3)
      #13 pc 0000000001829bc4  /data/app/~~44qBkY7NsjbVg_5Tg6ehCQ==/com.smart.happy-uiKspjljazPUIOGbYj5s4w==/lib/arm64/libflutter.so (BuildId: 15510187a6240786a32bdde8747cec6c0f6dcae3)
      #14 pc 000000000182d320  /data/app/~~44qBkY7NsjbVg_5Tg6ehCQ==/com.smart.happy-uiKspjljazPUIOGbYj5s4w==/lib/arm64/libflutter.so (BuildId: 15510187a6240786a32bdde8747cec6c0f6dcae3)
      #15 pc 0000000001829bc4  /data/app/~~44qBkY7NsjbVg_5Tg6ehCQ==/com.smart.happy-uiKspjljazPUIOGbYj5s4w==/lib/arm64/libflutter.so (BuildId: 15510187a6240786a32bdde8747cec6c0f6dcae3)
      #16 pc 000000000182d320  /data/app/~~44qBkY7NsjbVg_5Tg6ehCQ==/com.smart.happy-uiKspjljazPUIOGbYj5s4w==/lib/arm64/libflutter.so (BuildId: 15510187a6240786a32bdde8747cec6c0f6dcae3)
      #17 pc 0000000001829bc4  /data/app/~~44qBkY7NsjbVg_5Tg6ehCQ==/com.smart.happy-uiKspjljazPUIOGbYj5s4w==/lib/arm64/libflutter.so (BuildId: 15510187a6240786a32bdde8747cec6c0f6dcae3)
      #18 pc 000000000182c018  /data/app/~~44qBkY7NsjbVg_5Tg6ehCQ==/com.smart.happy-uiKspjljazPUIOGbYj5s4w==/lib/arm64/libflutter.so (BuildId: 15510187a6240786a32bdde8747cec6c0f6dcae3)
      #19 pc 0000000001829bc4  /data/app/~~44qBkY7NsjbVg_5Tg6ehCQ==/com.smart.happy-uiKspjljazPUIOGbYj5s4w==/lib/arm64/libflutter.so (BuildId: 15510187a6240786a32bdde8747cec6c0f6dcae3)
      #20 pc 000000000182d320  /data/app/~~44qBkY7NsjbVg_5Tg6ehCQ==/com.smart.happy-uiKspjljazPUIOGbYj5s4w==/lib/arm64/libflutter.so (BuildId: 15510187a6240786a32bdde8747cec6c0f6dcae3)
      #21 pc 0000000001829bc4  /data/app/~~44qBkY7NsjbVg_5Tg6ehCQ==/com.smart.happy-uiKspjljazPUIOGbYj5s4w==/lib/arm64/libflutter.so (BuildId: 15510187a6240786a32bdde8747cec6c0f6dcae3)
      #22 pc 000000000182b064  /data/app/~~44qBkY7NsjbVg_5Tg6ehCQ==/com.smart.happy-uiKspjljazPUIOGbYj5s4w==/lib/arm64/libflutter.so (BuildId: 15510187a6240786a32bdde8747cec6c0f6dcae3)
      #23 pc 00000000018266bc  /data/app/~~44qBkY7NsjbVg_5Tg6ehCQ==/com.smart.happy-uiKspjljazPUIOGbYj5s4w==/lib/arm64/libflutter.so (BuildId: 15510187a6240786a32bdde8747cec6c0f6dcae3)
      #24 pc 000000000183f9ec  /data/app/~~44qBkY7NsjbVg_5Tg6ehCQ==/com.smart.happy-uiKspjljazPUIOGbYj5s4w==/lib/arm64/libflutter.so (BuildId: 15510187a6240786a32bdde8747cec6c0f6dcae3)
      #25 pc 000000000183e7e4  /data/app/~~44qBkY7NsjbVg_5Tg6ehCQ==/com.smart.happy-uiKspjljazPUIOGbYj5s4w==/lib/arm64/libflutter.so (BuildId: 15510187a6240786a32bdde8747cec6c0f6dcae3)
      #26 pc 000000000183f2ac  /data/app/~~44qBkY7NsjbVg_5Tg6ehCQ==/com.smart.happy-uiKspjljazPUIOGbYj5s4w==/lib/arm64/libflutter.so (BuildId: 15510187a6240786a32bdde8747cec6c0f6dcae3)
      #27 pc 00000000018400a0  /data/app/~~44qBkY7NsjbVg_5Tg6ehCQ==/com.smart.happy-uiKspjljazPUIOGbYj5s4w==/lib/arm64/libflutter.so (BuildId: 15510187a6240786a32bdde8747cec6c0f6dcae3)
      #28 pc 000000000183ec14  /data/app/~~44qBkY7NsjbVg_5Tg6ehCQ==/com.smart.happy-uiKspjljazPUIOGbYj5s4w==/lib/arm64/libflutter.so (BuildId: 15510187a6240786a32bdde8747cec6c0f6dcae3)
      #29 pc 000000000183e980  /data/app/~~44qBkY7NsjbVg_5Tg6ehCQ==/com.smart.happy-uiKspjljazPUIOGbYj5s4w==/lib/arm64/libflutter.so (BuildId: 15510187a6240786a32bdde8747cec6c0f6dcae3)
      #30 pc 000000000184a634  /data/app/~~44qBkY7NsjbVg_5Tg6ehCQ==/com.smart.happy-uiKspjljazPUIOGbYj5s4w==/lib/arm64/libflutter.so (BuildId: 15510187a6240786a32bdde8747cec6c0f6dcae3)
      #31 pc 000000000152d5a0  /data/app/~~44qBkY7NsjbVg_5Tg6ehCQ==/com.smart.happy-uiKspjljazPUIOGbYj5s4w==/lib/arm64/libflutter.so (BuildId: 15510187a6240786a32bdde8747cec6c0f6dcae3)
      #32 pc 0000000001533b0c  /data/app/~~44qBkY7NsjbVg_5Tg6ehCQ==/com.smart.happy-uiKspjljazPUIOGbYj5s4w==/lib/arm64/libflutter.so (BuildId: 15510187a6240786a32bdde8747cec6c0f6dcae3)
      #33 pc 0000000000019da8  /system/lib64/libutils.so (android::Looper::pollInner(int)+916) (BuildId: 85aad54dcf3341150498b846bfca7931)
      #34 pc 00000000000199ac  /system/lib64/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+112) (BuildId: 85aad54dcf3341150498b846bfca7931)
      #35 pc 0000000000012c74  /system/lib64/libandroid.so (ALooper_pollOnce+100) (BuildId: 35fcec94a508276f883368d9eaad1c96)
      #36 pc 0000000001533a94  /data/app/~~44qBkY7NsjbVg_5Tg6ehCQ==/com.smart.happy-uiKspjljazPUIOGbYj5s4w==/lib/arm64/libflutter.so (BuildId: 15510187a6240786a32bdde8747cec6c0f6dcae3)
      #37 pc 000000000152d4e8  /data/app/~~44qBkY7NsjbVg_5Tg6ehCQ==/com.smart.happy-uiKspjljazPUIOGbYj5s4w==/lib/arm64/libflutter.so (BuildId: 15510187a6240786a32bdde8747cec6c0f6dcae3)
      #38 pc 0000000001531394  /data/app/~~44qBkY7NsjbVg_5Tg6ehCQ==/com.smart.happy-uiKspjljazPUIOGbYj5s4w==/lib/arm64/libflutter.so (BuildId: 15510187a6240786a32bdde8747cec6c0f6dcae3)
      #39 pc 00000000000da278  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+64) (BuildId: e81bf516b888e895d4e757da439c8117)
      #40 pc 000000000007a448  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: e81bf516b888e895d4e757da439c8117)
Lost connection to device.
Exited (sigterm)

zhangstar666 avatar Mar 14 '22 06:03 zhangstar666

This seems more like an issue with the OpenGL binding in Flutter rather than with this package. I think we need to open an issue on the Flutter Github page.

The problem is that i can't recreate this problem. Is it possible for you to check on which line the error occurs?

juliansteenbakker avatar Mar 14 '22 07:03 juliansteenbakker

I also encountered this issue after upgrading form 0.1.3 to 1.0.0. Debug and profile builds work fine for me in version 0.1.3 of the package. With version 1.0.0, i get the same error as @zhangstar666 with my Google Pixel 4A and Android 12. Release builds with 1.0.0 seem to be working correctly.

jonaspoxleitner avatar Mar 14 '22 10:03 jonaspoxleitner

@jonaspoxleitner Thanks for reporting. Can you tell me on which line the error occurs?

juliansteenbakker avatar Mar 14 '22 10:03 juliansteenbakker

Ok, thats really interesting. It seems like my issue hat nothing to do with the other one. flutter clean and flutter pub get fixed it for me. Now, debug and profile builds are working correctly for me. Anyway, here is my error if anyone should encounter the same issue in the future:

Launching lib/main_staging.dart on Pixel 4a in debug mode...
e: /usr/local/flutter/.pub-cache/hosted/pub.dartlang.org/mobile_scanner-0.1.3/android/src/main/kotlin/dev/steenbakker/mobile_scanner/BarcodeFormats.kt: (6, 12): Redeclaration: BarcodeFormats
e: /usr/local/flutter/.pub-cache/hosted/pub.dartlang.org/mobile_scanner-0.1.3/android/src/main/kotlin/dev/steenbakker/mobile_scanner/MobileScanner.kt: (27, 7): Redeclaration: MobileScanner
e: /usr/local/flutter/.pub-cache/hosted/pub.dartlang.org/mobile_scanner-1.0.0/android/src/main/kotlin/dev/steenbakker/mobile_scanner/BarcodeFormats.kt: (5, 12): Redeclaration: BarcodeFormats
e: /usr/local/flutter/.pub-cache/hosted/pub.dartlang.org/mobile_scanner-1.0.0/android/src/main/kotlin/dev/steenbakker/mobile_scanner/BarcodeFormats.kt: (6, 12): Cannot access '<init>': it is private in 'BarcodeFormats'
e: /usr/local/flutter/.pub-cache/hosted/pub.dartlang.org/mobile_scanner-1.0.0/android/src/main/kotlin/dev/steenbakker/mobile_scanner/BarcodeFormats.kt: (7, 16): Cannot access '<init>': it is private in 'BarcodeFormats'
e: /usr/local/flutter/.pub-cache/hosted/pub.dartlang.org/mobile_scanner-1.0.0/android/src/main/kotlin/dev/steenbakker/mobile_scanner/BarcodeFormats.kt: (7, 93): Cannot access '<init>': it is private in 'BarcodeFormats'
e: /usr/local/flutter/.pub-cache/hosted/pub.dartlang.org/mobile_scanner-1.0.0/android/src/main/kotlin/dev/steenbakker/mobile_scanner/BarcodeFormats.kt: (7, 166): Cannot access '<init>': it is private in 'BarcodeFormats'
e: /usr/local/flutter/.pub-cache/hosted/pub.dartlang.org/mobile_scanner-1.0.0/android/src/main/kotlin/dev/steenbakker/mobile_scanner/BarcodeFormats.kt: (10, 12): Cannot access '<init>': it is private in 'BarcodeFormats'
e: /usr/local/flutter/.pub-cache/hosted/pub.dartlang.org/mobile_scanner-1.0.0/android/src/main/kotlin/dev/steenbakker/mobile_scanner/BarcodeFormats.kt: (10, 84): Cannot access '<init>': it is private in 'BarcodeFormats'
e: /usr/local/flutter/.pub-cache/hosted/pub.dartlang.org/mobile_scanner-1.0.0/android/src/main/kotlin/dev/steenbakker/mobile_scanner/BarcodeFormats.kt: (10, 160): Cannot access '<init>': it is private in 'BarcodeFormats'
e: /usr/local/flutter/.pub-cache/hosted/pub.dartlang.org/mobile_scanner-1.0.0/android/src/main/kotlin/dev/steenbakker/mobile_scanner/BarcodeFormats.kt: (13, 11): Cannot access '<init>': it is private in 'BarcodeFormats'
e: /usr/local/flutter/.pub-cache/hosted/pub.dartlang.org/mobile_scanner-1.0.0/android/src/main/kotlin/dev/steenbakker/mobile_scanner/BarcodeFormats.kt: (13, 80): Cannot access '<init>': it is private in 'BarcodeFormats'
e: /usr/local/flutter/.pub-cache/hosted/pub.dartlang.org/mobile_scanner-1.0.0/android/src/main/kotlin/dev/steenbakker/mobile_scanner/BarcodeFormats.kt: (13, 146): Cannot access '<init>': it is private in 'BarcodeFormats'
e: /usr/local/flutter/.pub-cache/hosted/pub.dartlang.org/mobile_scanner-1.0.0/android/src/main/kotlin/dev/steenbakker/mobile_scanner/BarcodeFormats.kt: (16, 12): Cannot access '<init>': it is private in 'BarcodeFormats'
e: /usr/local/flutter/.pub-cache/hosted/pub.dartlang.org/mobile_scanner-1.0.0/android/src/main/kotlin/dev/steenbakker/mobile_scanner/BarcodeFormats.kt: (16, 82): Cannot access '<init>': it is private in 'BarcodeFormats'
e: /usr/local/flutter/.pub-cache/hosted/pub.dartlang.org/mobile_scanner-1.0.0/android/src/main/kotlin/dev/steenbakker/mobile_scanner/BarcodeFormats.kt: (16, 150): Cannot access '<init>': it is private in 'BarcodeFormats'
e: /usr/local/flutter/.pub-cache/hosted/pub.dartlang.org/mobile_scanner-1.0.0/android/src/main/kotlin/dev/steenbakker/mobile_scanner/BarcodeFormats.kt: (19, 11): Cannot access '<init>': it is private in 'BarcodeFormats'
e: /usr/local/flutter/.pub-cache/hosted/pub.dartlang.org/mobile_scanner-1.0.0/android/src/main/kotlin/dev/steenbakker/mobile_scanner/BarcodeFormats.kt: (19, 80): Cannot access '<init>': it is private in 'BarcodeFormats'
e: /usr/local/flutter/.pub-cache/hosted/pub.dartlang.org/mobile_scanner-1.0.0/android/src/main/kotlin/dev/steenbakker/mobile_scanner/MobileScanner.kt: (29, 7): Redeclaration: MobileScanner

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':mobile_scanner:compileDebugKotlin'.
> Compilation error. See log for more details

* 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 23s
Running Gradle task 'assembleStagingDebug'...                      23.9s
Exception: Gradle task assembleStagingDebug failed with exit code 1

jonaspoxleitner avatar Mar 14 '22 10:03 jonaspoxleitner

@jonaspoxleitner that seems like a caching issue. Glad you sorted it out.

juliansteenbakker avatar Mar 14 '22 11:03 juliansteenbakker

that seems like a caching issue. Glad you sorted it out. @jonaspoxleitner

I've tried to clear the cache before.

This problem still occurs, but it seems to be the only one in debug or profile mode.

zhangstar666 avatar Mar 14 '22 13:03 zhangstar666

yes @zhangstar666 that is a different issue. Can you open the android project at example/android, and run the app in debug mode from there? I hope you can see at which line the crash occurs. Maybe you can set some breakpoints here to see if thats where the crash occurs: https://github.com/juliansteenbakker/mobile_scanner/blob/8d965e29a5a2e74fdadf3c0e52f411926fc5ffb4/android/src/main/kotlin/dev/steenbakker/mobile_scanner/MobileScanner.kt#L155

juliansteenbakker avatar Mar 14 '22 15:03 juliansteenbakker

@juliansteenbakker I debuged the Android code.

It seems that there is something wrong with the way io.flutter.embedding.engine.renderer.SurfaceTextureWrapper handles Native callbacks (attachToGLContext).

The attachToGLContext method of SurfaceTextureWrapper calls the attachToGLContext of SurfaceTexture.

In the attachToGLContext method of SurfaceTexture, tell Native to get a JNI exception when loading OpenGL

SurfaceTextureWrapper- attachToGLContext function: image

Error File: android.graphics.android.graphics Error Code Line: 295 image

Android Crash log:

2022-03-15 10:56:56.185 2807-2843/dev.steenbakker.mobile_scanner_example 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:71)
2022-03-15 10:56:56.185 2807-2843/dev.steenbakker.mobile_scanner_example A/flutter: [FATAL:flutter/shell/platform/android/platform_view_android_jni_impl.cc(1301)] Check failed: fml::jni::CheckException(env). 
2022-03-15 10:56:56.186 2807-2843/dev.steenbakker.mobile_scanner_example A/libc: Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 2843 (1.raster), pid 2807 (scanner_example)

This seems more like an issue with the OpenGL binding in Flutter rather than with this package. I think we need to open an issue on the Flutter Github page.

The problem is that i can't recreate this problem. Is it possible for you to check on which line the error occurs?

zhangstar666 avatar Mar 15 '22 03:03 zhangstar666

yes @zhangstar666 that is a different issue. Can you open the android project at example/android, and run the app in debug mode from there? I hope you can see at which line the crash occurs. Maybe you can set some breakpoints here to see if thats where the crash occurs:

https://github.com/juliansteenbakker/mobile_scanner/blob/8d965e29a5a2e74fdadf3c0e52f411926fc5ffb4/android/src/main/kotlin/dev/steenbakker/mobile_scanner/MobileScanner.kt#L155

Doesn't this problem occur when you run in Flutter debug mode?

textureRegistry.createSurfaceTexture() ---> FlutterRenderer.createSurfaceTexture ---> FlutterRenderer.registerSurfaceTexture ---> FlutterJNI.registerTexture ---> FlutterJNI.nativeRegisterTexture(native function,I can't see the native code. I don't know the implementation of JNI.)

Maybe there is an exception after the nativeRegisterTexture method calls SurfaceTextureWrapper- attachToGLContext function?

zhangstar666 avatar Mar 15 '22 03:03 zhangstar666

Whatever it is, it seems like its part of the Flutter framework. Have you tried some newer flutter channels like flutter channel beta or flutter channel dev? After switching channels you need to execute flutter upgrade.

juliansteenbakker avatar Mar 16 '22 06:03 juliansteenbakker

Yes, the final error was thrown in the Flutter framework. I didn't switch Flutter channels, I just upgraded the Flutter from 2.8. 1 upgraded to 2.10.3.

zhangstar666 avatar Mar 16 '22 07:03 zhangstar666

I didn't switch Flutter channels, I just upgraded the Flutter from 2.8. 1 upgraded to 2.10.3.

I understand, but maybe there is a bug in version 2.10.3, so by switching to example the beta or dev channel, you can check if they already fixed the issue.

juliansteenbakker avatar Mar 19 '22 07:03 juliansteenbakker