mobile_scanner icon indicating copy to clipboard operation
mobile_scanner copied to clipboard

QR Scanner not opening for the second time

Open Vatsa0408 opened this issue 2 years ago • 3 comments

QR Scanner not scanning the QR Code for the second time.

Device Specifications

  • Flutter SDK version:- 3.0.1
  • Mobile Scanner version:- 2.0.0
  • minSDKVersion:- 21
  • CompileSDKVersion:- 32

Description

The mobile scanner will work for the first time. Once the QR code is scanned for the first time, the camera view will appear white for the second time onwards.

I have attached the error log

D/CameraOrientationUtil( 8440): getRelativeImageRotation: destRotationDegrees=90, sourceRotationDegrees=90, isOppositeFacing=true, result=0
D/CameraOrientationUtil( 8440): getRelativeImageRotation: destRotationDegrees=90, sourceRotationDegrees=90, isOppositeFacing=true, result=0
D/CameraOrientationUtil( 8440): getRelativeImageRotation: destRotationDegrees=90, sourceRotationDegrees=90, isOppositeFacing=true, result=0
D/DeferrableSurface( 8440): Surface created[total_surfaces=2, used_surfaces=0](androidx.camera.core.impl.ImmediateSurface@7932dfd}
D/Camera2CameraImpl( 8440): {Camera@94f69cd[id=0]} Use case androidx.camera.core.Preview-0c4a65ca-ca1e-47cf-ad7b-c444201f8d46266853189 ACTIVE
D/CameraOrientationUtil( 8440): getRelativeImageRotation: destRotationDegrees=90, sourceRotationDegrees=90, isOppositeFacing=true, result=0
D/UseCaseAttachState( 8440): Active and attached use case: [] for camera: 0
D/CameraOrientationUtil( 8440): getRelativeImageRotation: destRotationDegrees=90, sourceRotationDegrees=90, isOppositeFacing=true, result=0
I/LOG     ( 8440): Analyzer: 640x480
I/LOG     ( 8440): Preview: 1440x1080
D/TorchControl( 8440): Unable to enableTorch due to there is no flash unit.
D/CameraOrientationUtil( 8440): getRelativeImageRotation: destRotationDegrees=90, sourceRotationDegrees=90, isOppositeFacing=true, result=0
D/CameraOrientationUtil( 8440): getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=90, isOppositeFacing=true, result=90
D/DeferrableSurface( 8440): surface closed,  useCount=0 closed=true androidx.camera.core.SurfaceRequest$2@afa3e66
D/DeferrableSurface( 8440): Surface terminated[total_surfaces=1, used_surfaces=0](androidx.camera.core.SurfaceRequest$2@afa3e66}
D/DeferrableSurface( 8440): surface closed,  useCount=0 closed=true androidx.camera.core.impl.ImmediateSurface@7932dfd
D/DeferrableSurface( 8440): Surface terminated[total_surfaces=0, used_surfaces=0](androidx.camera.core.impl.ImmediateSurface@7932dfd}
D/Camera2CameraImpl( 8440): {Camera@94f69cd[id=0]} Use case androidx.camera.core.ImageAnalysis-4a9f5269-bb5f-4377-bb75-bd636e891521115708570 ACTIVE
D/UseCaseAttachState( 8440): Active and attached use case: [] for camera: 0
D/Camera2CameraImpl( 8440): {Camera@94f69cd[id=0]} Use cases [androidx.camera.core.Preview-0c4a65ca-ca1e-47cf-ad7b-c444201f8d46266853189, androidx.camera.core.ImageAnalysis-4a9f5269-bb5f-4377-bb75-bd636e891521115708570] now ATTACHED
D/UseCaseAttachState( 8440): All use case: [androidx.camera.core.Preview-0c4a65ca-ca1e-47cf-ad7b-c444201f8d46266853189, androidx.camera.core.ImageAnalysis-4a9f5269-bb5f-4377-bb75-bd636e891521115708570] for camera: 0
D/DeferrableSurface( 8440): Surface created[total_surfaces=1, used_surfaces=0](androidx.camera.core.SurfaceRequest$2@2850d16}
D/UseCaseAttachState( 8440): Active and attached use case: [androidx.camera.core.Preview-0c4a65ca-ca1e-47cf-ad7b-c444201f8d46266853189, androidx.camera.core.ImageAnalysis-4a9f5269-bb5f-4377-bb75-bd636e891521115708570] for camera: 0
D/CameraOrientationUtil( 8440): getRelativeImageRotation: destRotationDegrees=90, sourceRotationDegrees=90, isOppositeFacing=true, result=0
D/CameraOrientationUtil( 8440): getRelativeImageRotation: destRotationDegrees=90, sourceRotationDegrees=90, isOppositeFacing=true, result=0
D/CameraOrientationUtil( 8440): getRelativeImageRotation: destRotationDegrees=90, sourceRotationDegrees=90, isOppositeFacing=true, result=0
D/DeferrableSurface( 8440): Surface created[total_surfaces=2, used_surfaces=0](androidx.camera.core.impl.ImmediateSurface@870906d}
D/CameraOrientationUtil( 8440): getRelativeImageRotation: destRotationDegrees=90, sourceRotationDegrees=90, isOppositeFacing=true, result=0
D/Camera2CameraImpl( 8440): {Camera@94f69cd[id=0]} Resetting Capture Session
D/CameraOrientationUtil( 8440): getRelativeImageRotation: destRotationDegrees=90, sourceRotationDegrees=90, isOppositeFacing=true, result=0
D/Camera2CameraImpl( 8440): {Camera@94f69cd[id=0]} Releasing session in state INITIALIZED
I/LOG     ( 8440): Analyzer: 640x480
I/LOG     ( 8440): Preview: 1440x1080
D/Camera2CameraImpl( 8440): {Camera@94f69cd[id=0]} Attempting to force open the camera.
D/TorchControl( 8440): Unable to enableTorch due to there is no flash unit.
D/CameraStateRegistry( 8440): tryOpenCamera(Camera@94f69cd[id=0]) [Available Cameras: 1, Already Open: false (Previous state: CLOSED)] --> SUCCESS
D/CameraOrientationUtil( 8440): getRelativeImageRotation: destRotationDegrees=90, sourceRotationDegrees=90, isOppositeFacing=true, result=0
D/CameraOrientationUtil( 8440): getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=90, isOppositeFacing=true, result=90
D/CameraStateRegistry( 8440): Recalculating open cameras:
D/CameraStateRegistry( 8440): Camera                                       State
D/CameraStateRegistry( 8440): -------------------------------------------------------------------
D/CameraStateRegistry( 8440): Camera@94f69cd[id=0]                         OPENING
D/CameraStateRegistry( 8440): Camera@2f8eafc[id=1]                         UNKNOWN
D/CameraStateRegistry( 8440): -------------------------------------------------------------------
D/CameraStateRegistry( 8440): Open count: 1 (Max allowed: 1)
D/Camera2CameraImpl( 8440): {Camera@94f69cd[id=0]} Opening camera.
D/Camera2CameraImpl( 8440): {Camera@94f69cd[id=0]} Transitioning camera internal state: INITIALIZED --> OPENING
D/CameraStateMachine( 8440): New public camera state CameraState{type=OPENING, error=null} from OPENING and null
D/CameraStateMachine( 8440): Publishing new public camera state CameraState{type=OPENING, error=null}
D/UseCaseAttachState( 8440): All use case: [androidx.camera.core.Preview-0c4a65ca-ca1e-47cf-ad7b-c444201f8d46266853189, androidx.camera.core.ImageAnalysis-4a9f5269-bb5f-4377-bb75-bd636e891521115708570] for camera: 0
I/CameraManagerGlobal( 8440): postSingleUpdate device: camera id 0 status STATUS_NOT_AVAILABLE
I/CameraManagerGlobal( 8440): postSingleUpdate device: camera id 0 status STATUS_NOT_AVAILABLE
I/CameraManagerGlobal( 8440): Camera 0 facing CAMERA_FACING_BACK state now CAMERA_STATE_OPEN for client com.mdynamix.mxevalapp API Level 2
D/Camera2CameraImpl( 8440): {Camera@94f69cd[id=0]} Use case androidx.camera.core.Preview-0c4a65ca-ca1e-47cf-ad7b-c444201f8d46266853189 ACTIVE
D/UseCaseAttachState( 8440): Active and attached use case: [androidx.camera.core.Preview-0c4a65ca-ca1e-47cf-ad7b-c444201f8d46266853189, androidx.camera.core.ImageAnalysis-4a9f5269-bb5f-4377-bb75-bd636e891521115708570] for camera: 0
D/Camera2CameraImpl( 8440): {Camera@94f69cd[id=0]} Use case androidx.camera.core.ImageAnalysis-4a9f5269-bb5f-4377-bb75-bd636e891521115708570 ACTIVE
D/UseCaseAttachState( 8440): Active and attached use case: [androidx.camera.core.Preview-0c4a65ca-ca1e-47cf-ad7b-c444201f8d46266853189, androidx.camera.core.ImageAnalysis-4a9f5269-bb5f-4377-bb75-bd636e891521115708570] for camera: 0
D/Camera2CameraImpl( 8440): {Camera@94f69cd[id=0]} Use cases [androidx.camera.core.Preview-0c4a65ca-ca1e-47cf-ad7b-c444201f8d46266853189, androidx.camera.core.ImageAnalysis-4a9f5269-bb5f-4377-bb75-bd636e891521115708570] now DETACHED for camera
D/UseCaseAttachState( 8440): All use case: [] for camera: 0
D/Camera2CameraImpl( 8440): {Camera@94f69cd[id=0]} Resetting Capture Session
D/Camera2CameraImpl( 8440): {Camera@94f69cd[id=0]} Releasing session in state OPENING
D/UseCaseAttachState( 8440): Active and attached use case: [] for camera: 0
D/UseCaseAttachState( 8440): Active and attached use case: [] for camera: 0
D/Camera2CameraImpl( 8440): {Camera@94f69cd[id=0]} Closing camera.
D/Camera2CameraImpl( 8440): {Camera@94f69cd[id=0]} Transitioning camera internal state: OPENING --> CLOSING
D/CameraStateRegistry( 8440): Recalculating open cameras:
D/CameraStateRegistry( 8440): Camera                                       State
D/CameraStateRegistry( 8440): -------------------------------------------------------------------
D/CameraStateRegistry( 8440): Camera@94f69cd[id=0]                         CLOSING
D/CameraStateRegistry( 8440): Camera@2f8eafc[id=1]                         UNKNOWN
D/CameraStateRegistry( 8440): -------------------------------------------------------------------
D/CameraStateRegistry( 8440): Open count: 1 (Max allowed: 1)
D/CameraStateMachine( 8440): New public camera state CameraState{type=CLOSING, error=null} from CLOSING and null
D/CameraStateMachine( 8440): Publishing new public camera state CameraState{type=CLOSING, error=null}
D/Camera2CameraImpl( 8440): {Camera@94f69cd[id=0]} Use case androidx.camera.core.Preview-49a8c84e-fb75-44f7-b6c4-73f18d5cac1f42934197 ACTIVE
D/UseCaseAttachState( 8440): Active and attached use case: [] for camera: 0
D/Camera2CameraImpl( 8440): {Camera@94f69cd[id=0]} Use case androidx.camera.core.ImageAnalysis-dd8faad2-0d57-4453-b4cd-b40c56cbcff5228054602 ACTIVE
D/UseCaseAttachState( 8440): Active and attached use case: [] for camera: 0
D/Camera2CameraImpl( 8440): {Camera@94f69cd[id=0]} Use cases [androidx.camera.core.Preview-49a8c84e-fb75-44f7-b6c4-73f18d5cac1f42934197, androidx.camera.core.ImageAnalysis-dd8faad2-0d57-4453-b4cd-b40c56cbcff5228054602] now ATTACHED
D/UseCaseAttachState( 8440): All use case: [androidx.camera.core.Preview-49a8c84e-fb75-44f7-b6c4-73f18d5cac1f42934197, androidx.camera.core.ImageAnalysis-dd8faad2-0d57-4453-b4cd-b40c56cbcff5228054602] for camera: 0
D/UseCaseAttachState( 8440): Active and attached use case: [androidx.camera.core.Preview-49a8c84e-fb75-44f7-b6c4-73f18d5cac1f42934197, androidx.camera.core.ImageAnalysis-dd8faad2-0d57-4453-b4cd-b40c56cbcff5228054602] for camera: 0
D/Camera2CameraImpl( 8440): {Camera@94f69cd[id=0]} Resetting Capture Session
D/Camera2CameraImpl( 8440): {Camera@94f69cd[id=0]} Releasing session in state CLOSING
D/Camera2CameraImpl( 8440): {Camera@94f69cd[id=0]} Transitioning camera internal state: CLOSING --> REOPENING
D/CameraStateRegistry( 8440): Recalculating open cameras:
D/CameraStateRegistry( 8440): Camera                                       State
D/CameraStateRegistry( 8440): -------------------------------------------------------------------
D/CameraStateRegistry( 8440): Camera@94f69cd[id=0]                         OPENING
D/CameraStateRegistry( 8440): Camera@2f8eafc[id=1]                         UNKNOWN
D/CameraStateRegistry( 8440): -------------------------------------------------------------------
D/CameraStateRegistry( 8440): Open count: 1 (Max allowed: 1)
D/CameraStateMachine( 8440): New public camera state CameraState{type=OPENING, error=null} from OPENING and null
D/CameraStateMachine( 8440): Publishing new public camera state CameraState{type=OPENING, error=null}
D/Camera2CameraImpl( 8440): {Camera@94f69cd[id=0]} Use case androidx.camera.core.Preview-49a8c84e-fb75-44f7-b6c4-73f18d5cac1f42934197 ACTIVE
D/UseCaseAttachState( 8440): Active and attached use case: [androidx.camera.core.Preview-49a8c84e-fb75-44f7-b6c4-73f18d5cac1f42934197, androidx.camera.core.ImageAnalysis-dd8faad2-0d57-4453-b4cd-b40c56cbcff5228054602] for camera: 0
D/Camera2CameraImpl( 8440): {Camera@94f69cd[id=0]} Use case androidx.camera.core.ImageAnalysis-dd8faad2-0d57-4453-b4cd-b40c56cbcff5228054602 ACTIVE
D/UseCaseAttachState( 8440): Active and attached use case: [androidx.camera.core.Preview-49a8c84e-fb75-44f7-b6c4-73f18d5cac1f42934197, androidx.camera.core.ImageAnalysis-dd8faad2-0d57-4453-b4cd-b40c56cbcff5228054602] for camera: 0
D/Camera2CameraImpl( 8440): {Camera@94f69cd[id=0]} CameraDevice.onOpened()
D/Camera2CameraImpl( 8440): {Camera@94f69cd[id=0]} Transitioning camera internal state: REOPENING --> OPENED
D/CameraStateRegistry( 8440): Recalculating open cameras:
D/CameraStateRegistry( 8440): Camera                                       State
D/CameraStateRegistry( 8440): -------------------------------------------------------------------
D/CameraStateRegistry( 8440): Camera@94f69cd[id=0]                         OPEN
D/CameraStateRegistry( 8440): Camera@2f8eafc[id=1]                         UNKNOWN
D/CameraStateRegistry( 8440): -------------------------------------------------------------------
D/CameraStateRegistry( 8440): Open count: 1 (Max allowed: 1)
D/CameraStateMachine( 8440): New public camera state CameraState{type=OPEN, error=null} from OPEN and null
D/CameraStateMachine( 8440): Publishing new public camera state CameraState{type=OPEN, error=null}
D/UseCaseAttachState( 8440): All use case: [androidx.camera.core.Preview-49a8c84e-fb75-44f7-b6c4-73f18d5cac1f42934197, androidx.camera.core.ImageAnalysis-dd8faad2-0d57-4453-b4cd-b40c56cbcff5228054602] for camera: 0
D/UseCaseAttachState( 8440): Active and attached use case: [androidx.camera.core.Preview-49a8c84e-fb75-44f7-b6c4-73f18d5cac1f42934197, androidx.camera.core.ImageAnalysis-dd8faad2-0d57-4453-b4cd-b40c56cbcff5228054602] for camera: 0
D/UseCaseAttachState( 8440): Active and attached use case: [androidx.camera.core.Preview-49a8c84e-fb75-44f7-b6c4-73f18d5cac1f42934197, androidx.camera.core.ImageAnalysis-dd8faad2-0d57-4453-b4cd-b40c56cbcff5228054602] for camera: 0
D/SyncCaptureSessionBase( 8440): [androidx.camera.camera2.internal.SynchronizedCaptureSessionBaseImpl@6856d11] getSurface...done
D/CaptureSession( 8440): Opening capture session.
D/DeferrableSurface( 8440): New surface in use[total_surfaces=2, used_surfaces=1](androidx.camera.core.SurfaceRequest$2@2850d16}
D/DeferrableSurface( 8440): use count+1, useCount=1 androidx.camera.core.SurfaceRequest$2@2850d16
D/DeferrableSurface( 8440): New surface in use[total_surfaces=2, used_surfaces=2](androidx.camera.core.impl.ImmediateSurface@870906d}
D/DeferrableSurface( 8440): use count+1, useCount=1 androidx.camera.core.impl.ImmediateSurface@870906d
D/CaptureSession( 8440): Attempting to send capture request onConfigured
D/CaptureSession( 8440): Issuing request for session.
D/CaptureRequestBuilder( 8440): createCaptureRequest
D/CaptureSession( 8440): CameraCaptureSession.onConfigured() mState=OPENED
D/CaptureSession( 8440): CameraCaptureSession.onReady() OPENED
I/CameraManagerGlobal( 8440): Camera 0 facing CAMERA_FACING_BACK state now CAMERA_STATE_ACTIVE for client com.mdynamix.mxevalapp API Level 2
D/TransportRuntime.SQLiteEventStore( 8440): Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
D/TransportRuntime.JobInfoScheduler( 8440): Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
D/TransportRuntime.SQLiteEventStore( 8440): Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
D/TransportRuntime.JobInfoScheduler( 8440): Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
D/TransportRuntime.SQLiteEventStore( 8440): Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
D/TransportRuntime.JobInfoScheduler( 8440): Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
I/ViewRootImpl( 8440): updatePointerIcon pointerType = 1000, calling pid = 8440
D/InputManager( 8440): setPointerIconType iconId = 1000, callingPid = 8440
D/TransportRuntime.SQLiteEventStore( 8440): Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
D/TransportRuntime.JobInfoScheduler( 8440): Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
D/TransportRuntime.SQLiteEventStore( 8440): Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
D/TransportRuntime.JobInfoScheduler( 8440): Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
D/TransportRuntime.SQLiteEventStore( 8440): Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
D/TransportRuntime.JobInfoScheduler( 8440): Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
I/namix.mxevalap( 8440): Background concurrent copying GC freed 341807(15MB) AllocSpace objects, 4(1068KB) LOS objects, 49% free, 5005KB/10011KB, paused 382us total 103.181ms
W/System  ( 8440): A resource failed to call release.
W/System  ( 8440): A resource failed to call release.
D/TransportRuntime.SQLiteEventStore( 8440): Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
D/TransportRuntime.JobInfoScheduler( 8440): Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
D/TransportRuntime.SQLiteEventStore( 8440): Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
D/TransportRuntime.JobInfoScheduler( 8440): Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
D/TransportRuntime.SQLiteEventStore( 8440): Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
D/TransportRuntime.JobInfoScheduler( 8440): Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
I/ViewRootImpl@56c4510[MainActivity]( 8440): ViewPostIme pointer 0
I/ViewRootImpl@56c4510[MainActivity]( 8440): ViewPostIme pointer 1
I/flutter ( 8440): Scan QR: true
I/flutter ( 8440): Instance of 'RegiEventQRScanStop'
I/flutter ( 8440): 4, Regi: In BLoC RegiEventQRScanStop
I/flutter ( 8440): #main: onTransition - Instance of 'RegiEventQRScanStop': RegiStateSuccess() -> RegiStateInprogress()
I/flutter ( 8440): #main: onTransition - Instance of 'RegiEventQRScanStop': RegiStateInprogress() -> RegiStateSuccess()
I/flutter ( 8440): INIT, ROOT-UI: In ROOT SUCCESS
I/flutter ( 8440): bbc587a852ae1258
I/flutter ( 8440): bbc587a852ae1258
I/flutter ( 8440): ROOT:  x L:
I/flutter ( 8440): Root: Section Page: 0
I/flutter ( 8440): bbc587a852ae1258
I/flutter ( 8440): bbc587a852ae1258
I/flutter ( 8440): PreparationBarItems : index:0
I/flutter ( 8440): 4292337374
I/flutter ( 8440): PreparationBarItems : index:1
I/flutter ( 8440): 4292337374
I/flutter ( 8440): Meta, State: MetaStateSuccess(Instance of 'MetaModel') stage:IDLE msg:0
D/DeferrableSurface( 8440): surface closed,  useCount=1 closed=true androidx.camera.core.SurfaceRequest$2@2850d16
D/DeferrableSurface( 8440): surface closed,  useCount=1 closed=true androidx.camera.core.impl.ImmediateSurface@870906d
D/Camera2CameraImpl( 8440): {Camera@94f69cd[id=0]} Use cases [androidx.camera.core.Preview-49a8c84e-fb75-44f7-b6c4-73f18d5cac1f42934197, androidx.camera.core.ImageAnalysis-dd8faad2-0d57-4453-b4cd-b40c56cbcff5228054602] now DETACHED for camera
D/UseCaseAttachState( 8440): All use case: [] for camera: 0
D/Camera2CameraImpl( 8440): {Camera@94f69cd[id=0]} Resetting Capture Session
D/Camera2CameraImpl( 8440): {Camera@94f69cd[id=0]} Releasing session in state OPENED
D/UseCaseAttachState( 8440): Active and attached use case: [] for camera: 0
D/UseCaseAttachState( 8440): Active and attached use case: [] for camera: 0
D/Camera2CameraImpl( 8440): {Camera@94f69cd[id=0]} Closing camera.
D/Camera2CameraImpl( 8440): {Camera@94f69cd[id=0]} Transitioning camera internal state: OPENED --> CLOSING
D/CameraStateRegistry( 8440): Recalculating open cameras:
D/CameraStateRegistry( 8440): Camera                                       State
D/CameraStateRegistry( 8440): -------------------------------------------------------------------
D/CameraStateRegistry( 8440): Camera@94f69cd[id=0]                         CLOSING
D/CameraStateRegistry( 8440): Camera@2f8eafc[id=1]                         UNKNOWN
D/CameraStateRegistry( 8440): -------------------------------------------------------------------
D/CameraStateRegistry( 8440): Open count: 1 (Max allowed: 1)
D/CameraStateMachine( 8440): New public camera state CameraState{type=CLOSING, error=null} from CLOSING and null
D/CameraStateMachine( 8440): Publishing new public camera state CameraState{type=CLOSING, error=null}
D/Camera2CameraImpl( 8440): {Camera@94f69cd[id=0]} Resetting Capture Session
D/Camera2CameraImpl( 8440): {Camera@94f69cd[id=0]} Releasing session in state CLOSING
D/CaptureSession( 8440): onSessionFinished()
I/flutter ( 8440): MobileScanner: Called stop() while already stopped!

════════ Exception caught by services library ══════════════════════════════════
PlatformException(error, No active stream to cancel, null, null)
════════════════════════════════════════════════════════════════════════════════
E/BufferQueueProducer( 8440): [SurfaceTexture-0-8440-3](id:20f800000006,api:4,p:4670,c:8440) cancelBuffer: BufferQueue has been abandoned
E/BufferQueueProducer( 8440): [SurfaceTexture-0-8440-3](id:20f800000006,api:4,p:4670,c:8440) cancelBuffer: BufferQueue has been abandoned
E/BufferQueueProducer( 8440): [SurfaceTexture-0-8440-3](id:20f800000006,api:4,p:4670,c:8440) cancelBuffer: BufferQueue has been abandoned
E/BufferQueueProducer( 8440): [SurfaceTexture-0-8440-3](id:20f800000006,api:4,p:4670,c:8440) cancelBuffer: BufferQueue has been abandoned
E/BufferQueueProducer( 8440): [SurfaceTexture-0-8440-3](id:20f800000006,api:4,p:4670,c:8440) cancelBuffer: BufferQueue has been abandoned
E/BufferQueueProducer( 8440): [SurfaceTexture-0-8440-3](id:20f800000006,api:4,p:4670,c:8440) cancelBuffer: BufferQueue has been abandoned
E/BufferQueueProducer( 8440): [SurfaceTexture-0-8440-3](id:20f800000006,api:4,p:4670,c:8440) cancelBuffer: BufferQueue has been abandoned
I/CameraManagerGlobal( 8440): Camera 0 facing CAMERA_FACING_BACK state now CAMERA_STATE_IDLE for client com.mdynamix.mxevalapp API Level 2
W/namix.mxevalap( 8440): Long monitor contention with owner CameraX-core_camera_1 (10773) at void android.hardware.camera2.impl.CameraDeviceImpl.close()(CameraDeviceImpl.java:1334) waiters=0 in void android.hardware.camera2.impl.CameraDeviceImpl$CameraDeviceCallbacks.onCaptureStarted(android.hardware.camera2.impl.CaptureResultExtras, long) for 662ms
D/UseCaseAttachState( 8440): Active and attached use case: [] for camera: 0
I/CameraManagerGlobal( 8440): postSingleUpdate device: camera id 0 status STATUS_PRESENT
I/CameraManagerGlobal( 8440): postSingleUpdate device: camera id 0 status STATUS_PRESENT
D/DeferrableSurface( 8440): use count-1,  useCount=0 closed=true androidx.camera.core.SurfaceRequest$2@2850d16
D/DeferrableSurface( 8440): Surface no longer in use[total_surfaces=2, used_surfaces=1](androidx.camera.core.SurfaceRequest$2@2850d16}
D/DeferrableSurface( 8440): Surface terminated[total_surfaces=1, used_surfaces=1](androidx.camera.core.SurfaceRequest$2@2850d16}
I/CameraManagerGlobal( 8440): Camera 0 facing CAMERA_FACING_BACK state now CAMERA_STATE_CLOSED for client com.mdynamix.mxevalapp API Level 2
D/DeferrableSurface( 8440): use count-1,  useCount=0 closed=true androidx.camera.core.impl.ImmediateSurface@870906d
D/DeferrableSurface( 8440): Surface no longer in use[total_surfaces=1, used_surfaces=0](androidx.camera.core.impl.ImmediateSurface@870906d}
D/DeferrableSurface( 8440): Surface terminated[total_surfaces=0, used_surfaces=0](androidx.camera.core.impl.ImmediateSurface@870906d}
D/Camera2CameraImpl( 8440): {Camera@94f69cd[id=0]} CameraDevice.onClosed()
D/Camera2CameraImpl( 8440): {Camera@94f69cd[id=0]} Transitioning camera internal state: CLOSING --> INITIALIZED
D/CameraStateRegistry( 8440): Recalculating open cameras:
D/CameraStateRegistry( 8440): Camera                                       State
D/CameraStateRegistry( 8440): -------------------------------------------------------------------
D/CameraStateRegistry( 8440): Camera@94f69cd[id=0]                         CLOSED
D/CameraStateRegistry( 8440): Camera@2f8eafc[id=1]                         UNKNOWN
D/CameraStateRegistry( 8440): -------------------------------------------------------------------
D/CameraStateRegistry( 8440): Open count: 0 (Max allowed: 1)
D/CameraStateMachine( 8440): New public camera state CameraState{type=CLOSED, error=null} from CLOSED and null
D/CameraStateMachine( 8440): Publishing new public camera state CameraState{type=CLOSED, error=null}

I am also attaching the UI when I want to scan the QR code for the second time image

The image below is obtained when I want to scan the QR code for the first time image

Kindly let me know about the solution for the above error

Vatsa0408 avatar Jun 22 '22 15:06 Vatsa0408

It is possible to rescan a QR Code simply setting allowDuplicates: true, but this cause a lot of fired event that you need to manage with some very bad implementations..

In my opinion we are looking for some code that reset the "scanned code memory" once for example controller.stop() is called. In this way the developer can simply call controller.stop() once identified the QR Code in order to executed the wanted logic, once controller.start() is called the "scanned code memory" will be erased giving user the possibility to rescan the same QR Code.

enricobenedos avatar Jul 05 '22 17:07 enricobenedos

Looking at the repo code seems that all the "magic" is done by lastScanned string in the MobileScanner widget. @juliansteenbakker can it be an idea to move this variable in the controller class and manage it with the stop() or a new method to reset it? In this way the developer can simply decide if a QR Code can be newly scanned without allowDuplicates: true.

enricobenedos avatar Jul 05 '22 17:07 enricobenedos

I have the same problem but its occurs even if i block the device screen when the camera is open

iUnknownWs avatar Aug 28 '22 06:08 iUnknownWs

Since there has been lots of updates, please check with latest version 3.0.0-beta.4 and comment if this issue still exists.

juliansteenbakker avatar Dec 13 '22 20:12 juliansteenbakker

I updated to version 3.0.0-beta.4 and the camera view is visible now but scanning seems to stop working. We have the MobileScanner in a widget that needs to be toggled to show the scanner button. Toggling that widget on and off and on again makes it work. It was the same in version 2.

r-ilagan avatar Dec 16 '22 16:12 r-ilagan