mobile_scanner icon indicating copy to clipboard operation
mobile_scanner copied to clipboard

Error: Called start() while already started!

Open burekas7 opened this issue 1 year ago • 20 comments

Hi, @navaronbracke

What could be the reason of this error in the ErrorBuilder? Called start() while already started!

It doesn't happen all the times, it happens for example when I restart the app when I was in a screen that is using the MobileScanner, and open the screen again.

Mostly happens in Debug mode.

I have also issues when I navigate from a screen that has a Scanner in it to a new screen with the Scanner using push, so in the screens stack there are multiple instances with MobileScanner. Calling the "stop()" before doesn't help.

How can I avoid this?

How can I check if MobileScanner was already started?

How can I actually create and use multiple instances of the Scanner?

burekas7 avatar Jun 09 '24 11:06 burekas7

Is this related to using hot reload? If so, we have an open issue for that https://github.com/juliansteenbakker/mobile_scanner/issues/773

The underlying issue is that we should just ignore duplicate calls to the start method, when the controller is already starting. One example of that, is a lifecycle switch initiated by the permission dialog.

I have a PR that should fix this issue, https://github.com/juliansteenbakker/mobile_scanner/pull/1086 but I need to test it on our supported platforms.

If you're willing to test out that fix, in relation to app lifecycle changes on our supported platforms (Android, iOS, MacOS, Web) that would be very helpful in proving that that PR fixes the issue.

When it comes to using multiple instances of the MobileScanner widget, you probably need to stop or dispose the old controller before going to a new screen. We do not support multiple instances at once, since there is only one connection to the camera output at a given time.

navaronbracke avatar Jun 09 '24 16:06 navaronbracke

Hey @navaronbracke- I don't think it's related to hot reloads. It happens for me, even when just opening for the first time. Specifically I copied over the code from example repo, specifically the BarcodeScannerWithOverlay.

I have not changed any code yet. But is it flaky, because initially it worked fine.

simplenotezy avatar Jun 15 '24 17:06 simplenotezy

@simplenotezy I ran a test on the branch for the "already started" issue.

I did see that hot restart is broken when the camera preview is in use, but otherwise I didn't have any issues.

1) Normal use (no hot reload or hot restart) works fine
2) Hot restart (shift + r)
- does not work when invoked when the camera preview is running (camera preview is a black screen, controller cannot be started)
- does work when the camera is not in use (i.e. no active MobileScannerController is being used)
3) Hot reload (r)
- works when the camera is not in use
- work when the camera is in use

navaronbracke avatar Jun 17 '24 15:06 navaronbracke

Cool. So you could confirm the issue right?

simplenotezy avatar Jun 17 '24 21:06 simplenotezy

Only the hot restart issue when the preview is open, but yes there definitely is an issue here.

navaronbracke avatar Jun 18 '24 06:06 navaronbracke

Only the hot restart issue when the preview is open, but yes there definitely is an issue here.

hi!!

is there any fix for this error? @navaronbracke

pedroserretti avatar Jul 01 '24 12:07 pedroserretti

Main issue is that we cannot stop/restart it. There should be a way to "restart" native camera plugin...in case of such exception. As now if this happens, disposing of current controller doesnt help, and we cannot start new one.

radvansky-tomas avatar Jul 05 '24 01:07 radvansky-tomas

I had the same problem。

It reports an error : MobileScannerException: code genericError, message: Called start() while already started


              D  surface closed,  useCount=2 closed=true androidx.camera.core.SurfaceRequest$2@f8b15e7
              D  surface closed,  useCount=0 closed=true androidx.camera.core.processing.SurfaceEdge$SettableSurface@f3e440b
              D  Surface terminated[total_surfaces=2, used_surfaces=2](androidx.camera.core.processing.SurfaceEdge$SettableSurface@f3e440b}
              D  use count-1,  useCount=1 closed=true androidx.camera.core.SurfaceRequest$2@f8b15e7
              D  surface closed,  useCount=1 closed=true androidx.camera.core.impl.ImmediateSurface@c5ceb39
              D  {Camera@94bc7a[id=0]} Use cases [androidx.camera.core.Preview-a01f2278-4a02-4ffd-87a5-2acf4ad5bef525040879, androidx.camera.core.ImageAnalysis-93839dcd-d15a-46f9-a669-67e423dc899d265630460] now DETACHED for camera
              D  All use case: [] for camera: 0
              D  {Camera@94bc7a[id=0]} Resetting Capture Session
              D  {Camera@94bc7a[id=0]} Releasing session in state OPENED
              D  Active and attached use case: [] for camera: 0
              D  Active and attached use case: [] for camera: 0
              D  {Camera@94bc7a[id=0]} Closing camera.
              D  {Camera@94bc7a[id=0]} Transitioning camera internal state: OPENED --> CLOSING
              D  Recalculating open cameras:
                                                                                                    Camera                                       State                 
                                                                                                    -------------------------------------------------------------------
                                                                                                    Camera@bca60d2[id=1]                         UNKNOWN               
                                                                                                    Camera@94bc7a[id=0]                          CLOSING               
                                                                                                    -------------------------------------------------------------------
                                                                                                    Open count: 1 (Max allowed: 1)
              D  New public camera state CameraState{type=CLOSING, error=null} from CLOSING and null
              D  Publishing new public camera state CameraState{type=CLOSING, error=null}
              D  {Camera@94bc7a[id=0]} Resetting Capture Session
              D  {Camera@94bc7a[id=0]} Releasing session in state CLOSING
              D  onSessionFinished()
              E  [SurfaceTexture-0-26589-57] dequeueBuffer: BufferQueue has been abandoned
              E  [SurfaceTexture-0-26589-57] queueBuffer: BufferQueue has been abandoned
              E  [SurfaceTexture-0-26589-57] queueBuffer: BufferQueue has been abandoned
              E  [SurfaceTexture-0-26589-57] queueBuffer: BufferQueue has been abandoned
              E  [SurfaceTexture-0-26589-57] queueBuffer: BufferQueue has been abandoned
              E  [SurfaceTexture-0-26589-57] queueBuffer: BufferQueue has been abandoned
              W  ignore the torch status update of camera: 3
              W  ignore the torch status update of camera: 4
              D  Active and attached use case: [] for camera: 0
              D  use count-1,  useCount=0 closed=true androidx.camera.core.SurfaceRequest$2@f8b15e7
              D  Surface no longer in use[total_surfaces=2, used_surfaces=1](androidx.camera.core.SurfaceRequest$2@f8b15e7}
              D  Surface terminated[total_surfaces=1, used_surfaces=1](androidx.camera.core.SurfaceRequest$2@f8b15e7}
              D  use count-1,  useCount=0 closed=true androidx.camera.core.impl.ImmediateSurface@c5ceb39
              D  Surface no longer in use[total_surfaces=1, used_surfaces=0](androidx.camera.core.impl.ImmediateSurface@c5ceb39}
              D  Surface terminated[total_surfaces=0, used_surfaces=0](androidx.camera.core.impl.ImmediateSurface@c5ceb39}
              D  {Camera@94bc7a[id=0]} CameraDevice.onClosed()
              D  {Camera@94bc7a[id=0]} Transitioning camera internal state: CLOSING --> INITIALIZED
              D  Recalculating open cameras:
                                                                                                    Camera                                       State                 
                                                                                                    -------------------------------------------------------------------
                                                                                                    Camera@bca60d2[id=1]                         UNKNOWN               
                                                                                                    Camera@94bc7a[id=0]                          CLOSED                
                                                                                                    -------------------------------------------------------------------
                                                                                                    Open count: 0 (Max allowed: 1)
              D  New public camera state CameraState{type=CLOSED, error=null} from CLOSED and null
              D  Publishing new public camera state CameraState{type=CLOSED, error=null}
              D  getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=90, isOppositeFacing=true, result=90
              D  getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=90, isOppositeFacing=true, result=90
              D  Resolved dynamic range for use case androidx.camera.core.Preview-e9a633a1-7575-4a46-a178-1adb87d081d9 to no compatible HDR dynamic ranges.
                                                                                                    DynamicRange@197103d{encoding=UNSPECIFIED, bitDepth=0}
                                                                                                    ->
                                                                                                    DynamicRange@b0e0d94{encoding=SDR, bitDepth=8}
              D  getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=90, isOppositeFacing=true, result=90
              D  Surface created[total_surfaces=1, used_surfaces=0](androidx.camera.core.processing.SurfaceEdge$SettableSurface@9507e2d}
              D  Surface created[total_surfaces=2, used_surfaces=0](androidx.camera.core.SurfaceRequest$2@e63d029}
              D  New surface in use[total_surfaces=2, used_surfaces=1](androidx.camera.core.SurfaceRequest$2@e63d029}
              D  use count+1, useCount=1 androidx.camera.core.SurfaceRequest$2@e63d029
              D  getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=90, isOppositeFacing=true, result=90
) identical 1 line
              D  getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=90, isOppositeFacing=true, result=90
              D  Surface created[total_surfaces=3, used_surfaces=1](androidx.camera.core.impl.ImmediateSurface@ac7b8ba}
              D  getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=90, isOppositeFacing=true, result=90
              D  getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=90, isOppositeFacing=true, result=90
              D  {Camera@94bc7a[id=0]} Use case androidx.camera.core.Preview-e9a633a1-7575-4a46-a178-1adb87d081d973896945 ACTIVE
              D  Active and attached use case: [] for camera: 0
              D  {Camera@94bc7a[id=0]} Use case androidx.camera.core.ImageAnalysis-c3f051ae-afc1-49fd-9016-f7b7e8a89333211000278 ACTIVE
              D  Active and attached use case: [] for camera: 0
              D  {Camera@94bc7a[id=0]} Use cases [androidx.camera.core.Preview-e9a633a1-7575-4a46-a178-1adb87d081d973896945, androidx.camera.core.ImageAnalysis-c3f051ae-afc1-49fd-9016-f7b7e8a89333211000278] now ATTACHED
              D  All use case: [androidx.camera.core.Preview-e9a633a1-7575-4a46-a178-1adb87d081d973896945, androidx.camera.core.ImageAnalysis-c3f051ae-afc1-49fd-9016-f7b7e8a89333211000278] for camera: 0
              D  Active and attached use case: [androidx.camera.core.Preview-e9a633a1-7575-4a46-a178-1adb87d081d973896945, androidx.camera.core.ImageAnalysis-c3f051ae-afc1-49fd-9016-f7b7e8a89333211000278] for camera: 0
              D  {Camera@94bc7a[id=0]} Resetting Capture Session
              D  {Camera@94bc7a[id=0]} Releasing session in state INITIALIZED
              D  {Camera@94bc7a[id=0]} Attempting to force open the camera.
              D  tryOpenCamera(Camera@94bc7a[id=0]) [Available Cameras: 1, Already Open: false (Previous state: CLOSED)] --> SUCCESS
              D  Recalculating open cameras:
                                                                                                    Camera                                       State                 
                                                                                                    -------------------------------------------------------------------
                                                                                                    Camera@bca60d2[id=1]                         UNKNOWN               
                                                                                                    Camera@94bc7a[id=0]                          OPENING               
                                                                                                    -------------------------------------------------------------------
                                                                                                    Open count: 1 (Max allowed: 1)
              D  {Camera@94bc7a[id=0]} Opening camera.
              D  {Camera@94bc7a[id=0]} Transitioning camera internal state: INITIALIZED --> OPENING
              D  New public camera state CameraState{type=OPENING, error=null} from OPENING and null
              W  type=1400 audit(0.0:3830): avc: denied { read } for name="u:object_r:camera_prop:s0" dev="tmpfs" ino=20379 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:camera_prop:s0 tclass=file permissive=0
              D  Publishing new public camera state CameraState{type=OPENING, error=null}
              D  All use case: [androidx.camera.core.Preview-e9a633a1-7575-4a46-a178-1adb87d081d973896945, androidx.camera.core.ImageAnalysis-c3f051ae-afc1-49fd-9016-f7b7e8a89333211000278] for camera: 0
              E  Access denied finding property "persist.camera.privapp.list"
", camera ID 0) for HAL version default and Camera API version 2
 (PID 26589, UID 10169)
              W  ignore the torch status update of camera: 3
              W  ignore the torch status update of camera: 4
              D  {Camera@94bc7a[id=0]} Use case androidx.camera.core.Preview-e9a633a1-7575-4a46-a178-1adb87d081d973896945 ACTIVE
              D  Active and attached use case: [androidx.camera.core.Preview-e9a633a1-7575-4a46-a178-1adb87d081d973896945, androidx.camera.core.ImageAnalysis-c3f051ae-afc1-49fd-9016-f7b7e8a89333211000278] for camera: 0
              D  {Camera@94bc7a[id=0]} Use case androidx.camera.core.ImageAnalysis-c3f051ae-afc1-49fd-9016-f7b7e8a89333211000278 ACTIVE
              I  MobileScannerException: code genericError, message: Called start() while already started
              D  Active and attached use case: [androidx.camera.core.Preview-e9a633a1-7575-4a46-a178-1adb87d081d973896945, androidx.camera.core.ImageAnalysis-c3f051ae-afc1-49fd-9016-f7b7e8a89333211000278] for camera: 0
              D  {Camera@94bc7a[id=0]} Issue capture request
              D  Active and attached use case: [androidx.camera.core.Preview-e9a633a1-7575-4a46-a178-1adb87d081d973896945, androidx.camera.core.ImageAnalysis-c3f051ae-afc1-49fd-9016-f7b7e8a89333211000278] for camera: 0
              D  {Camera@94bc7a[id=0]} CameraDevice.onOpened()
              D  {Camera@94bc7a[id=0]} Transitioning camera internal state: OPENING --> OPENED
              D  Recalculating open cameras:
                                                                                                    Camera                                       State                 
                                                                                                    -------------------------------------------------------------------
                                                                                                    Camera@bca60d2[id=1]                         UNKNOWN               
                                                                                                    Camera@94bc7a[id=0]                          OPEN                  
                                                                                                    -------------------------------------------------------------------
                                                                                                    Open count: 1 (Max allowed: 1)
              D  New public camera state CameraState{type=OPEN, error=null} from OPEN and null
              D  Publishing new public camera state CameraState{type=OPEN, error=null}
              D  All use case: [androidx.camera.core.Preview-e9a633a1-7575-4a46-a178-1adb87d081d973896945, androidx.camera.core.ImageAnalysis-c3f051ae-afc1-49fd-9016-f7b7e8a89333211000278] for camera: 0
              D  Active and attached use case: [androidx.camera.core.Preview-e9a633a1-7575-4a46-a178-1adb87d081d973896945, androidx.camera.core.ImageAnalysis-c3f051ae-afc1-49fd-9016-f7b7e8a89333211000278] for camera: 0
              D  [androidx.camera.camera2.internal.SynchronizedCaptureSessionBaseImpl@aac970d] getSurface...done
              D  Opening capture session.
              D  use count+1, useCount=2 androidx.camera.core.SurfaceRequest$2@e63d029
              D  New surface in use[total_surfaces=3, used_surfaces=2](androidx.camera.core.impl.ImmediateSurface@ac7b8ba}
              D  use count+1, useCount=1 androidx.camera.core.impl.ImmediateSurface@ac7b8ba
              D  Attempting to send capture request onConfigured
              D  Issuing request for session.
              D  createCaptureRequest
              D  Issuing capture request.
              D  createCaptureRequest
              D  CameraCaptureSession.onConfigured() mState=OPENED
              D  CameraCaptureSession.onReady() OPENED
 (PID 26589, UID 10169)
 (PID 26589, UID 10169)
              E  Couldn't encode request, returning with 400
                                                                                                    java.net.SocketTimeoutException: failed to connect to firebaselogging.googleapis.com/172.217.163.42 (port 443) from /192.168.1.123 (port 42240) after 30000ms
                                                                                                    	at libcore.io.IoBridge.connectErrno(IoBridge.java:185)
                                                                                                    	at libcore.io.IoBridge.connect(IoBridge.java:130)
                                                                                                    	at java.net.PlainSocketImpl.socketConnect(PlainSocketImpl.java:129)
                                                                                                    	at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:356)
                                                                                                    	at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
                                                                                                    	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
                                                                                                    	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:357)
                                                                                                    	at java.net.Socket.connect(Socket.java:616)
                                                                                                    	at com.android.okhttp.internal.Platform.connectSocket(Platform.java:145)
                                                                                                    	at com.android.okhttp.internal.io.RealConnection.connectSocket(RealConnection.java:141)
                                                                                                    	at com.android.okhttp.internal.io.RealConnection.connect(RealConnection.java:112)
                                                                                                    	at com.android.okhttp.internal.http.StreamAllocation.findConnection(StreamAllocation.java:184)
                                                                                                    	at com.android.okhttp.internal.http.StreamAllocation.findHealthyConnection(StreamAllocation.java:126)
                                                                                                    	at com.android.okhttp.internal.http.StreamAllocation.newStream(StreamAllocation.java:95)
                                                                                                    	at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:281)
                                                                                                    	at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:224)
                                                                                                    	at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:461)
                                                                                                    	at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:127)
                                                                                                    	at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:258)
                                                                                                    	at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getOutputStream(DelegatingHttpsURLConnection.java:218)
                                                                                                    	at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getOutputStream(Unknown Source:0)
                                                                                                    	at com.google.android.datatransport.cct.CctTransportBackend.doSend(CctTransportBackend.java:304)
                                                                                                    	at com.google.android.datatransport.cct.CctTransportBackend.access$lambda$0(Unknown Source:0)
                                                                                                    	at com.google.android.datatransport.cct.CctTransportBackend$$Lambda$1.apply(Unknown Source:4)
                                                                                                    	at com.google.android.datatransport.runtime.retries.Retries.retry(Retries.java:54)
                                                                                                    	at com.google.android.datatransport.cct.CctTransportBackend.send(CctTransportBackend.java:373)
                                                                                                    	at com.google.android.datatransport.runtime.scheduling.jobscheduling.Uploader.logAndUpdateState(Uploader.java:121)
                                                                                                    	at com.google.android.datatransport.runtime.scheduling.jobscheduling.Uploader.lambda$upload$1(Uploader.java:88)
                                                                                                    	at com.google.android.datatransport.runtime.scheduling.jobscheduling.Uploader$$Lambda$1.run(Unknown Source:8)
                                                                                                    	at com.google.android.datatransport.runtime.SafeLoggingExecutor$SafeLoggingRunnable.run(SafeLoggingExecutor.java:47)
                                                                                                    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
                                                                                                    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
                                                                                                    	at java.lang.Thread.run(Thread.java:764)
              D  Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
              D  Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
              D  Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
              D  Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
              D  Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
              D  Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
              D  Storing event with priority=DEFAULT, name=FIREBASE_ML_SDK for destination cct
              D  Scheduling upload for context TransportContext(cct, DEFAULT, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) with jobId=-496425306 in 30000ms(Backend next call timestamp 0). Attempt 1
              D  Storing event with priority=DEFAULT, name=FIREBASE_ML_SDK for destination cct
              D  Upload for context TransportContext(cct, DEFAULT, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
              D  Storing event with priority=DEFAULT, name=FIREBASE_ML_SDK for destination cct
              D  Upload for context TransportContext(cct, DEFAULT, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
              D  Storing event with priority=DEFAULT, name=FIREBASE_ML_SDK for destination cct
              D  Upload for context TransportContext(cct, DEFAULT, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
              D  Storing event with priority=DEFAULT, name=FIREBASE_ML_SDK for destination cct
              D  Upload for context TransportContext(cct, DEFAULT, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
              D  Storing event with priority=DEFAULT, name=FIREBASE_ML_SDK for destination cct
              D  Upload for context TransportContext(cct, DEFAULT, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
              D  Storing event with priority=DEFAULT, name=FIREBASE_ML_SDK for destination cct
              D  Upload for context TransportContext(cct, DEFAULT, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
              D  Storing event with priority=DEFAULT, name=FIREBASE_ML_SDK for destination cct
              D  Upload for context TransportContext(cct, DEFAULT, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
              D  Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
              D  Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
              D  Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
              D  Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
              D  Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
              D  Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
              D  Storing event with priority=DEFAULT, name=FIREBASE_ML_SDK for destination cct
              D  Upload for context TransportContext(cct, DEFAULT, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
              D  Storing event with priority=DEFAULT, name=FIREBASE_ML_SDK for destination cct
              D  Upload for context TransportContext(cct, DEFAULT, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
              D  Storing event with priority=DEFAULT, name=FIREBASE_ML_SDK for destination cct
              D  Upload for context TransportContext(cct, DEFAULT, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
              D  Storing event with priority=DEFAULT, name=FIREBASE_ML_SDK for destination cct
              D  Upload for context TransportContext(cct, DEFAULT, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
              D  Storing event with priority=DEFAULT, name=FIREBASE_ML_SDK for destination cct
              D  Upload for context TransportContext(cct, DEFAULT, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
              D  Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
              D  Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
              D  Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
              D  Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
              D  Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
              D  Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
              D  Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
              D  Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
              D  Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
              D  Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
              D  Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
              D  Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
2024-09-05 19:17:32.669  1573-1573  wpa_supplicant          wpa_supplicant                       D  wlan0: BSS: Remove id 360 BSSID 0a:74:8d:d4:c1:0d SSID 'aventon2.4G' due to no match in scan
2024-09-05 19:17:32.671  1573-1573  wpa_supplicant          wpa_supplicant                       D  p2p0: BSS: Remove id 375 BSSID 0a:74:8d:d4:c1:0d SSID 'aventon2.4G' due to no match in scan
              D  Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
              D  Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
              D  Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
              D  Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
              D  Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
              D  Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
              D  Making request to: https://firebaselogging.googleapis.com/v0cc/log/batch?format=json_proto3
2024-09-05 19:19:21.314  1573-1573  wpa_supplicant          wpa_supplicant                       D  wlan0: BSS: Remove id 355 BSSID 06:74:8d:d4:c1:0e SSID 'Aventon' due to wpa_bss_flush_by_age
2024-09-05 19:19:21.314  1573-1573  wpa_supplicant          wpa_supplicant                       D  p2p0: BSS: Remove id 370 BSSID 06:74:8d:d4:c1:0e SSID 'Aventon' due to wpa_bss_flush_by_age
              E  Couldn't encode request, returning with 400
                                                                                                    java.net.SocketTimeoutException: failed to connect to firebaselogging.googleapis.com/172.217.163.42 (port 443) from /192.168.1.123 (port 42250) after 30000ms
                                                                                                    	at libcore.io.IoBridge.connectErrno(IoBridge.java:185)
                                                                                                    	at libcore.io.IoBridge.connect(IoBridge.java:130)
                                                                                                    	at java.net.PlainSocketImpl.socketConnect(PlainSocketImpl.java:129)
                                                                                                    	at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:356)
                                                                                                    	at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
                                                                                                    	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
                                                                                                    	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:357)
                                                                                                    	at java.net.Socket.connect(Socket.java:616)
                                                                                                    	at com.android.okhttp.internal.Platform.connectSocket(Platform.java:145)
                                                                                                    	at com.android.okhttp.internal.io.RealConnection.connectSocket(RealConnection.java:141)
                                                                                                    	at com.android.okhttp.internal.io.RealConnection.connect(RealConnection.java:112)
                                                                                                    	at com.android.okhttp.internal.http.StreamAllocation.findConnection(StreamAllocation.java:184)
                                                                                                    	at com.android.okhttp.internal.http.StreamAllocation.findHealthyConnection(StreamAllocation.java:126)
                                                                                                    	at com.android.okhttp.internal.http.StreamAllocation.newStream(StreamAllocation.java:95)
                                                                                                    	at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:281)
                                                                                                    	at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:224)
                                                                                                    	at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:461)
                                                                                                    	at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:127)
                                                                                                    	at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:258)
                                                                                                    	at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getOutputStream(DelegatingHttpsURLConnection.java:218)
                                                                                                    	at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getOutputStream(Unknown Source:0)
                                                                                                    	at com.google.android.datatransport.cct.CctTransportBackend.doSend(CctTransportBackend.java:304)
                                                                                                    	at com.google.android.datatransport.cct.CctTransportBackend.access$lambda$0(Unknown Source:0)
                                                                                                    	at com.google.android.datatransport.cct.CctTransportBackend$$Lambda$1.apply(Unknown Source:4)
                                                                                                    	at com.google.android.datatransport.runtime.retries.Retries.retry(Retries.java:54)
                                                                                                    	at com.google.android.datatransport.cct.CctTransportBackend.send(CctTransportBackend.java:373)
                                                                                                    	at com.google.android.datatransport.runtime.scheduling.jobscheduling.Uploader.logAndUpdateState(Uploader.java:121)
                                                                                                    	at com.google.android.datatransport.runtime.scheduling.jobscheduling.Uploader.lambda$upload$1(Uploader.java:88)
                                                                                                    	at com.google.android.datatransport.runtime.scheduling.jobscheduling.Uploader$$Lambda$1.run(Unknown Source:8)
                                                                                                    	at com.google.android.datatransport.runtime.SafeLoggingExecutor$SafeLoggingRunnable.run(SafeLoggingExecutor.java:47)
                                                                                                    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
                                                                                                    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
                                                                                                    	at java.lang.Thread.run(Thread.java:764)
              D  Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
              D  Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
              D  Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
              D  Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
              D  Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
              D  Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
              D  Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
              D  Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
              D  Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
              D  Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
              D  Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
              D  Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
              D  Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
              D  Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
              D  Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
              D  Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
              D  Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
              D  Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
              D  Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
              D  Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
              D  Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
              D  Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
              D  Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
              D  Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
              D  Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
              D  Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
              D  Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
              D  Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
              D  Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
              D  Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
2024-09-05 19:20:38.324  1573-1573  wpa_supplicant          wpa_supplicant                       D  wlan0: BSS: Add new id 371 BSSID 06:74:8d:d4:c5:a6 SSID 'Aventon' freq 5180
2024-09-05 19:20:38.325  1573-1573  wpa_supplicant          wpa_supplicant                       D  p2p0: BSS: Add new id 386 BSSID 06:74:8d:d4:c5:a6 SSID 'Aventon' freq 5180
              D  Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
              D  Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
              D  Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
              D  Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
              D  Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
              D  Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
              D  Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
              D  Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
              D  Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
              D  Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
              D  Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
              D  Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
              D  {Camera@94bc7a[id=0]} Use cases [androidx.camera.core.Preview-e9a633a1-7575-4a46-a178-1adb87d081d973896945, androidx.camera.core.ImageAnalysis-c3f051ae-afc1-49fd-9016-f7b7e8a89333211000278] now DETACHED for camera
              D  All use case: [] for camera: 0
              D  {Camera@94bc7a[id=0]} Resetting Capture Session
              D  {Camera@94bc7a[id=0]} Releasing session in state OPENED
              D  Active and attached use case: [] for camera: 0
              D  Active and attached use case: [] for camera: 0
              D  {Camera@94bc7a[id=0]} Closing camera.
              D  {Camera@94bc7a[id=0]} Transitioning camera internal state: OPENED --> CLOSING
              D  Recalculating open cameras:
                                                                                                    Camera                                       State                 
                                                                                                    -------------------------------------------------------------------
                                                                                                    Camera@bca60d2[id=1]                         UNKNOWN               
                                                                                                    Camera@94bc7a[id=0]                          CLOSING               
                                                                                                    -------------------------------------------------------------------
                                                                                                    Open count: 1 (Max allowed: 1)
              D  New public camera state CameraState{type=CLOSING, error=null} from CLOSING and null
              D  Publishing new public camera state CameraState{type=CLOSING, error=null}
              D  {Camera@94bc7a[id=0]} Resetting Capture Session
              D  {Camera@94bc7a[id=0]} Releasing session in state CLOSING
              D  onSessionFinished()

              W  ignore the torch status update of camera: 3
              W  ignore the torch status update of camera: 4
              D  Active and attached use case: [] for camera: 0
              W  Long monitor contention with owner CameraX-core_camera_1 (26694) at void android.hardware.camera2.impl.CameraDeviceImpl.close()(CameraDeviceImpl.java:1062) waiters=0 in void android.hardware.camera2.impl.CameraDeviceImpl$CameraDeviceCallbacks.onCaptureStarted(android.hardware.camera2.impl.CaptureResultExtras, long) for 591ms
              D  use count-1,  useCount=1 closed=false androidx.camera.core.SurfaceRequest$2@e63d029
              D  use count-1,  useCount=0 closed=false androidx.camera.core.impl.ImmediateSurface@ac7b8ba
              D  Surface no longer in use[total_surfaces=3, used_surfaces=1](androidx.camera.core.impl.ImmediateSurface@ac7b8ba}
              D  {Camera@94bc7a[id=0]} CameraDevice.onClosed()
              D  {Camera@94bc7a[id=0]} Transitioning camera internal state: CLOSING --> INITIALIZED
              D  Recalculating open cameras:
                                                                                                    Camera                                       State                 
                                                                                                    -------------------------------------------------------------------
                                                                                                    Camera@bca60d2[id=1]                         UNKNOWN               
                                                                                                    Camera@94bc7a[id=0]                          CLOSED                
                                                                                                    -------------------------------------------------------------------
                                                                                                    Open count: 0 (Max allowed: 1)
              D  New public camera state CameraState{type=CLOSED, error=null} from CLOSED and null
              D  Publishing new public camera state CameraState{type=CLOSED, error=null}


ychen3022 avatar Sep 05 '24 11:09 ychen3022

Just curious if this is still affecting people other than myself?

sharpsan avatar Sep 13 '24 19:09 sharpsan

This is probably still affecting people, but we don't have many "thumbs up" for the original post. I do have a WIP patch for his bug, but I should probably clean it up and test it.

navaronbracke avatar Sep 13 '24 21:09 navaronbracke

I "fixed" it in my own branch: https://github.com/navaronbracke/mobile_scanner/commit/78236fab0c0c667820388bd2a8cdc3b6d4f320c6

radvansky-tomas avatar Sep 13 '24 22:09 radvansky-tomas

@radvansky-tomas That is only for iOS and not for Android / MacOS or web, though.

navaronbracke avatar Sep 14 '24 08:09 navaronbracke

Yeah i didnt have that issue there though

Dr. Tomas Radvansky

On Sat, 14 Sep 2024 at 20:34, Navaron Bracke @.***> wrote:

@radvansky-tomas https://github.com/radvansky-tomas That is only for iOS and not for Android / MacOS or web, though.

— Reply to this email directly, view it on GitHub https://github.com/juliansteenbakker/mobile_scanner/issues/1091#issuecomment-2350913836, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC7FKQCTCMTLQLW7X2XYEO3ZWPYLDAVCNFSM6AAAAABJAZTPQCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNJQHEYTGOBTGY . You are receiving this because you were mentioned.Message ID: @.***>

radvansky-tomas avatar Sep 14 '24 08:09 radvansky-tomas

Same, it was Android for me as well

sharpsan avatar Sep 14 '24 15:09 sharpsan

Having this issue and it's not really clear what can be done to resolve it. My expectation here is that any initialization logic is idempotent / fails gracefully

lukepighetti avatar Sep 16 '24 18:09 lukepighetti

What my patch aims to do is the following: if we already started we should not throw an error, period. Just do nothing instead, since starting an already started camera is redundant.

Although, stopping and restarting the camera is another option. What would you prefer?

navaronbracke avatar Sep 16 '24 19:09 navaronbracke

@navaronbracke I'm not sure if this is the cause of all cases showing this error.

But, basically I solved the problem related to this based on the workaround mentioned here (by using "VisibilityDetector"): https://github.com/juliansteenbakker/mobile_scanner/issues/1002

By stopping the scanner when navigating to another screen that may use the Scanner/Camera while the scanner is still active on the previous screen in the screen stack. And activating it again when returning to the screen.

It's a bit tricky, but it works.

burekas7 avatar Sep 16 '24 22:09 burekas7

Thats not solving underlaying issue that native controller is not related to dart one. So if iOS / Android "camera" is still active and dart has no clue about it it fails. We need to handle this situation gracefully, recreate controller and attach to dart counterpart.

radvansky-tomas avatar Sep 17 '24 02:09 radvansky-tomas

this issue is still happening in both android and ios. stop() doesn't do anything , also does't matter what you do if you pop the screen that has the mobile_scanner widget and push it again ,the error is still there, there is no way to reset it.

martinpelli avatar Oct 04 '24 00:10 martinpelli

Finally, I use the delay function invoke start. It's work for me.

Cheng455153666 avatar Oct 23 '24 02:10 Cheng455153666

I think this issue will be fixed in v6.0.9. If not, please let me know.

juliansteenbakker avatar Apr 18 '25 21:04 juliansteenbakker

I think this issue will be fixed in v6.0.9. If not, please let me know. Thanks.

What does it mean? So I won't need the "VisibilityDetector" workaround anymore when I navigate to a new screen that also has a MobileScanner instance, while the previous screen still has an active instance of MobileScanner? Do I need to stop the controller or anything else before navigate to the new screen?

burekas7 avatar Apr 19 '25 13:04 burekas7

Do I need to stop the controller or anything else before navigate to the new screen?

Yes you should stop/dispose the controller before navigating and start it again on the new screen. We do not yet support multiple MobileScannerControllers running at the same time

navaronbracke avatar Apr 19 '25 15:04 navaronbracke

 @override
  void didChangeAppLifecycleState(AppLifecycleState state) async {
    // If the controller is not ready, do not try to start or stop it.
    // Permission dialogs can trigger lifecycle changes before the controller is ready.
    if (!scannerController.value.isInitialized) {
      return;
    }

    switch (state) {
      case AppLifecycleState.detached:
      case AppLifecycleState.hidden:
      case AppLifecycleState.paused:
        return;
      case AppLifecycleState.resumed:
        // Restart the scanner when the app is resumed.
        // Don't forget to resume listening to the barcode events.

        unawaited(scannerController.start());
      case AppLifecycleState.inactive:
        // Stop the scanner when the app is paused.
        // Also stop the barcode events subscription.
    if (scannerController.value.isInitialized) {
      unawaited(scannerController.start());
    }

  @override
  void initState() {
    WidgetsBinding.instance.addObserver(this);
    scannerController = MobileScannerController();

    // Finally, start the scanner itself.
    if (scannerController.value.isInitialized) {
      unawaited(scannerController.start());
    }
    super.initState();
  }

  @override
  void dispose() async {
    WidgetsBinding.instance.removeObserver(this);
    super.dispose();
    await scannerController.stop();
    await scannerController.dispose();
  }

i solved it by just add this line of code if (scannerController.value.isInitialized) { unawaited(scannerController.start()); }

huzaifansari54 avatar Apr 29 '25 11:04 huzaifansari54

I think this issue will be fixed in v6.0.9. If not, please let me know.

I'm still facing this issue

hosamafiky avatar Jun 18 '25 17:06 hosamafiky