Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Doesn't work on Android 14 #1077

Closed
tanvir93 opened this issue May 26, 2024 · 28 comments
Closed

Doesn't work on Android 14 #1077

tanvir93 opened this issue May 26, 2024 · 28 comments
Assignees
Labels
android Platform android bug Something isn't working MLKit

Comments

@tanvir93
Copy link

tanvir93 commented May 26, 2024

After some investigation, this seems to be related to #698 which indicates Android probably needs to use NV21 instead of YUV

I got this package as a charm.

I tested this package on Android 6.5 (API 23) to Android 13.0 (API 33), and it works perfectly.

But it does not work on Android 14 (API 34). The camera opens as expected, but no barcodes are captured/detected, and there is no error log.

Any of you are experiencing this? Got any solution?

@navaronbracke
Copy link
Collaborator

Does Logcat provide any information in this case?

@tanvir93
Copy link
Author

The whole Logcat output:

W/WindowOnBackDispatcher( 1581): OnBackInvokedCallback is not enabled for the application.
W/WindowOnBackDispatcher( 1581): Set 'android:enableOnBackInvokedCallback="true"' in the application manifest.
W/libc    ( 1581): Access denied finding property "vendor.display.enable_display_extensions"
W/om.mydomainname.app( 1581): type=1400 audit(0.0:11081949): avc:  denied  { read } for  name="u:object_r:vendor_display_prop:s0" dev="tmpfs" ino=435 scontext=u:r:untrusted_app_32:s0:c11,c257,c512,c768 tcontext=u:object_r:vendor_display_prop:s0 tclass=file permissive=0 app=com.mydomainname.app
D/TransportRuntime.SQLiteEventStore( 1581): Storing event with priority=DEFAULT, name=FIREBASE_ML_SDK for destination cct
D/CameraOrientationUtil( 1581): getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=90, isOppositeFacing=true, result=90
D/CameraOrientationUtil( 1581): getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=90, isOppositeFacing=true, result=90
D/TransportRuntime.JobInfoScheduler( 1581): Upload for context TransportContext(cct, DEFAULT, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
D/DynamicRangeResolver( 1581): Resolved dynamic range for use case androidx.camera.core.Preview-c6180b54-6ada-4230-a27d-ddc0d060a670 to no compatible HDR dynamic ranges.
D/DynamicRangeResolver( 1581): DynamicRange@560f801{encoding=UNSPECIFIED, bitDepth=0}
D/DynamicRangeResolver( 1581): ->
D/DynamicRangeResolver( 1581): DynamicRange@61b69e8{encoding=SDR, bitDepth=8}

======== Exception caught by scheduler library =====================================================
The following assertion was thrown during a scheduler callback:
There are multiple heroes that share the same tag within a subtree.

Within each subtree for which heroes are to be animated (i.e. a PageRoute subtree), each Hero must have a unique non-null tag.
In this case, multiple heroes had the following tag: <default FloatingActionButton tag>
Here is the subtree for one of the offending heroes: Hero
  tag: <default FloatingActionButton tag>
  state: _HeroState#0e352
When the exception was thrown, this was the stack: 
#0      Hero._allHeroesFor.inviteHero.<anonymous closure> (package:flutter/src/widgets/heroes.dart:277:11)
#1      Hero._allHeroesFor.inviteHero (package:flutter/src/widgets/heroes.dart:288:8)
#2      Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:306:11)
#3      SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:6755:14)
#4      Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:321:15)
#5      ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5539:14)
#6      Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:321:15)
#7      SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:6755:14)
#8      Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:321:15)
#9      ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5539:14)
#10     Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:321:15)
#11     SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:6755:14)
#12     Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:321:15)
#13     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5539:14)
#14     Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:321:15)
#15     MultiChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:6867:16)
#16     Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:321:15)
#17     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5539:14)
#18     Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:321:15)
#19     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5539:14)
#20     Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:321:15)
#21     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5539:14)
#22     Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:321:15)
#23     MultiChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:6867:16)
#24     Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:321:15)
#25     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5539:14)
#26     Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:321:15)
#27     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5539:14)
#28     Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:321:15)
#29     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5539:14)
#30     Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:321:15)
#31     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5539:14)
#32     Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:321:15)
#33     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5539:14)
#34     Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:321:15)
#35     SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:6755:14)
#36     Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:321:15)
#37     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5539:14)
#38     Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:321:15)
#39     SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:6755:14)
#40     Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:321:15)
#41     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5539:14)
#42     Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:321:15)
#43     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5539:14)
#44     Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:321:15)
#45     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5539:14)
#46     Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:321:15)
#47     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5539:14)
#48     Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:321:15)
#49     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5539:14)
#50     Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:321:15)
#51     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5539:14)
#52     Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:321:15)
#53     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5539:14)
#54     Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:321:15)
#55     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5539:14)
#56     Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:321:15)
#57     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5539:14)
#58     Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:321:15)
#59     SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:6755:14)
#60     Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:321:15)
#61     SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:6755:14)
#62     Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:321:15)
#63     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5539:14)
#64     Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:321:15)
#65     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5539:14)
#66     Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:321:15)
#67     MultiChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:6867:16)
#68     Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:321:15)
#69     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5539:14)
#70     Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:321:15)
#71     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5539:14)
#72     Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:321:15)
#73     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5539:14)
#74     Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:321:15)
#75     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5539:14)
#76     Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:321:15)
#77     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5539:14)
#78     Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:321:15)
#79     MultiChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:6867:16)
#80     Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:321:15)
#81     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5539:14)
#82     Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:321:15)
#83     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5539:14)
#84     Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:321:15)
#85     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5539:14)
#86     Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:321:15)
#87     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5539:14)
#88     Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:321:15)
#89     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5539:14)
#90     Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:321:15)
#91     SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:6755:14)
#92     Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:321:15)
#93     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5539:14)
#94     Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:321:15)
#95     SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:6755:14)
#96     Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:321:15)
#97     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5539:14)
#98     Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:321:15)
#99     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5539:14)
#100    Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:321:15)
#101    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5539:14)
#102    Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:321:15)
#103    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5539:14)
#104    Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:321:15)
#105    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5539:14)
#106    Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:321:15)
#107    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5539:14)
#108    Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:321:15)
#109    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5539:14)
#110    Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:321:15)
#111    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5539:14)
#112    Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:321:15)
#113    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5539:14)
#114    Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:321:15)
#115    SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:6755:14)
#116    Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:321:15)
#117    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5539:14)
#118    Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:321:15)
#119    SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:6755:14)
#120    Element.visitChildElements (package:flutter/src/widgets/framework.dart:3721:5)
#121    Hero._allHeroesFor (package:flutter/src/widgets/heroes.dart:324:13)
#122    HeroController._startHeroTransition (package:flutter/src/widgets/heroes.dart:967:14)
#123    HeroController._maybeStartHeroTransition.<anonymous closure> (package:flutter/src/widgets/heroes.dart:926:9)
#124    SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1392:15)
#125    SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1326:11)
#126    SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:1171:5)
#127    _invoke (dart:ui/hooks.dart:312:13)
#128    PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:419:5)
#129    _drawFrame (dart:ui/hooks.dart:283:31)
====================================================================================================
D/CameraOrientationUtil( 1581): getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=90, isOppositeFacing=true, result=90
D/DeferrableSurface( 1581): Surface created[total_surfaces=1, used_surfaces=0](androidx.camera.core.processing.SurfaceEdge$SettableSurface@df656e}
D/DeferrableSurface( 1581): Surface created[total_surfaces=2, used_surfaces=0](androidx.camera.core.SurfaceRequest$2@d206a7a}
D/DeferrableSurface( 1581): New surface in use[total_surfaces=2, used_surfaces=1](androidx.camera.core.SurfaceRequest$2@d206a7a}
D/DeferrableSurface( 1581): use count+1, useCount=1 androidx.camera.core.SurfaceRequest$2@d206a7a
D/CameraOrientationUtil( 1581): getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=90, isOppositeFacing=true, result=90
D/CameraOrientationUtil( 1581): getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=90, isOppositeFacing=true, result=90
D/CameraOrientationUtil( 1581): getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=90, isOppositeFacing=true, result=90
D/DeferrableSurface( 1581): Surface created[total_surfaces=3, used_surfaces=1](androidx.camera.core.impl.ImmediateSurface@1104607}
D/Camera2CameraImpl( 1581): {Camera@86223a5[id=0]} Use case androidx.camera.core.Preview-c6180b54-6ada-4230-a27d-ddc0d060a670224975138 ACTIVE
D/UseCaseAttachState( 1581): Active and attached use case: [] for camera: 0
D/CameraOrientationUtil( 1581): getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=90, isOppositeFacing=true, result=90
D/Camera2CameraImpl( 1581): {Camera@86223a5[id=0]} Use case androidx.camera.core.ImageAnalysis-be868ae4-b9b1-4422-b85c-cb20a2bc79dc169410483 ACTIVE
D/CameraOrientationUtil( 1581): getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=90, isOppositeFacing=true, result=90
D/UseCaseAttachState( 1581): Active and attached use case: [] for camera: 0
D/Camera2CameraImpl( 1581): {Camera@86223a5[id=0]} Use cases [androidx.camera.core.Preview-c6180b54-6ada-4230-a27d-ddc0d060a670224975138, androidx.camera.core.ImageAnalysis-be868ae4-b9b1-4422-b85c-cb20a2bc79dc169410483] now ATTACHED
D/UseCaseAttachState( 1581): All use case: [androidx.camera.core.Preview-c6180b54-6ada-4230-a27d-ddc0d060a670224975138, androidx.camera.core.ImageAnalysis-be868ae4-b9b1-4422-b85c-cb20a2bc79dc169410483] for camera: 0
D/UseCaseAttachState( 1581): Active and attached use case: [androidx.camera.core.Preview-c6180b54-6ada-4230-a27d-ddc0d060a670224975138, androidx.camera.core.ImageAnalysis-be868ae4-b9b1-4422-b85c-cb20a2bc79dc169410483] for camera: 0
D/Camera2CameraImpl( 1581): {Camera@86223a5[id=0]} Resetting Capture Session
D/Camera2CameraImpl( 1581): {Camera@86223a5[id=0]} Releasing session in state INITIALIZED
D/Camera2CameraImpl( 1581): {Camera@86223a5[id=0]} Attempting to force open the camera.
D/CameraStateRegistry( 1581): tryOpenCamera(Camera@86223a5[id=0]) [Available Cameras: 1, Already Open: false (Previous state: CLOSED)] --> SUCCESS
D/CameraStateRegistry( 1581): Recalculating open cameras:
D/CameraStateRegistry( 1581): Camera                                       State                 
D/CameraStateRegistry( 1581): -------------------------------------------------------------------
D/CameraStateRegistry( 1581): Camera@86223a5[id=0]                         OPENING               
D/CameraStateRegistry( 1581): Camera@24f9434[id=1]                         UNKNOWN               
D/CameraStateRegistry( 1581): -------------------------------------------------------------------
D/CameraStateRegistry( 1581): Open count: 1 (Max allowed: 1)
D/Camera2CameraImpl( 1581): {Camera@86223a5[id=0]} Opening camera.
D/Camera2CameraImpl( 1581): {Camera@86223a5[id=0]} Transitioning camera internal state: INITIALIZED --> OPENING
D/CameraStateMachine( 1581): New public camera state CameraState{type=OPENING, error=null} from OPENING and null
D/CameraStateMachine( 1581): Publishing new public camera state CameraState{type=OPENING, error=null}
D/UseCaseAttachState( 1581): All use case: [androidx.camera.core.Preview-c6180b54-6ada-4230-a27d-ddc0d060a670224975138, androidx.camera.core.ImageAnalysis-be868ae4-b9b1-4422-b85c-cb20a2bc79dc169410483] for camera: 0
I/OplusCameraManagerGlobal( 1581): setClientInfo, packageName: com.mydomainname.app, uid: 10267, pid: 1581
W/libc    ( 1581): Access denied finding property "persist.vendor.camera.privapp.list"
I/OplusCameraManagerGlobal( 1581): setClientInfo, packageName: com.mydomainname.app, uid: 10267, pid: 1581
I/OplusCameraUtils( 1581): current activityName: com.mydomainname.app.MainActivity
I/OplusCameraUtils( 1581): getComponentName, componentName: com.mydomainname.app/com.mydomainname.app.MainActivity, packageName:com.mydomainname.app, activityName:com.mydomainname.app.MainActivity
I/CameraManager( 1581): openCameraDeviceUserAsync, use componentName: com.mydomainname.app/com.mydomainname.app.MainActivity
I/OplusCameraUtils( 1581): current activityName: com.mydomainname.app.MainActivity
I/OplusCameraUtils( 1581): getComponentName, componentName: com.mydomainname.app/com.mydomainname.app.MainActivity, packageName:com.mydomainname.app, activityName:com.mydomainname.app.MainActivity
W/libc    ( 1581): Access denied finding property "vendor.camera.aux.packagelist"
W/libc    ( 1581): Access denied finding property "vendor.camera.aux.packagelist"
D/Camera2CameraImpl( 1581): {Camera@86223a5[id=0]} Use case androidx.camera.core.Preview-c6180b54-6ada-4230-a27d-ddc0d060a670224975138 ACTIVE
D/UseCaseAttachState( 1581): Active and attached use case: [androidx.camera.core.Preview-c6180b54-6ada-4230-a27d-ddc0d060a670224975138, androidx.camera.core.ImageAnalysis-be868ae4-b9b1-4422-b85c-cb20a2bc79dc169410483] for camera: 0
D/Camera2CameraImpl( 1581): {Camera@86223a5[id=0]} Use case androidx.camera.core.ImageAnalysis-be868ae4-b9b1-4422-b85c-cb20a2bc79dc169410483 ACTIVE
D/UseCaseAttachState( 1581): Active and attached use case: [androidx.camera.core.Preview-c6180b54-6ada-4230-a27d-ddc0d060a670224975138, androidx.camera.core.ImageAnalysis-be868ae4-b9b1-4422-b85c-cb20a2bc79dc169410483] for camera: 0
D/Camera2CameraImpl( 1581): {Camera@86223a5[id=0]} Issue capture request
D/UseCaseAttachState( 1581): Active and attached use case: [androidx.camera.core.Preview-c6180b54-6ada-4230-a27d-ddc0d060a670224975138, androidx.camera.core.ImageAnalysis-be868ae4-b9b1-4422-b85c-cb20a2bc79dc169410483] for camera: 0
D/Camera2CameraImpl( 1581): {Camera@86223a5[id=0]} CameraDevice.onOpened()
D/Camera2CameraImpl( 1581): {Camera@86223a5[id=0]} Transitioning camera internal state: OPENING --> OPENED
D/CameraStateRegistry( 1581): Recalculating open cameras:
D/CameraStateRegistry( 1581): Camera                                       State                 
D/CameraStateRegistry( 1581): -------------------------------------------------------------------
D/CameraStateRegistry( 1581): Camera@86223a5[id=0]                         OPEN                  
D/CameraStateRegistry( 1581): Camera@24f9434[id=1]                         UNKNOWN               
D/CameraStateRegistry( 1581): -------------------------------------------------------------------
D/CameraStateRegistry( 1581): Open count: 1 (Max allowed: 1)
D/CameraStateMachine( 1581): New public camera state CameraState{type=OPEN, error=null} from OPEN and null
D/CameraStateMachine( 1581): Publishing new public camera state CameraState{type=OPEN, error=null}
D/UseCaseAttachState( 1581): All use case: [androidx.camera.core.Preview-c6180b54-6ada-4230-a27d-ddc0d060a670224975138, androidx.camera.core.ImageAnalysis-be868ae4-b9b1-4422-b85c-cb20a2bc79dc169410483] for camera: 0
D/OplusCamera2StatisticsManager( 1581): addInfo, eventMap: {halLevel=3, cameraId=0, pkgName=com.mydomainname.app, connentTime=1716894035788, apLevel=2}
D/UseCaseAttachState( 1581): Active and attached use case: [androidx.camera.core.Preview-c6180b54-6ada-4230-a27d-ddc0d060a670224975138, androidx.camera.core.ImageAnalysis-be868ae4-b9b1-4422-b85c-cb20a2bc79dc169410483] for camera: 0
D/SyncCaptureSessionBase( 1581): [androidx.camera.camera2.internal.SynchronizedCaptureSessionBaseImpl@c6e32ce] getSurface...done
D/CaptureSession( 1581): Opening capture session.
D/DeferrableSurface( 1581): use count+1, useCount=2 androidx.camera.core.SurfaceRequest$2@d206a7a
D/DeferrableSurface( 1581): New surface in use[total_surfaces=3, used_surfaces=2](androidx.camera.core.impl.ImmediateSurface@1104607}
D/DeferrableSurface( 1581): use count+1, useCount=1 androidx.camera.core.impl.ImmediateSurface@1104607
D/CaptureSession( 1581): Attempting to send capture request onConfigured
D/CaptureSession( 1581): Issuing request for session.
D/Camera2CaptureRequestBuilder( 1581): createCaptureRequest
D/CaptureSession( 1581): Issuing capture request.
D/Camera2CaptureRequestBuilder( 1581): createCaptureRequest
D/CaptureSession( 1581): CameraCaptureSession.onConfigured() mState=OPENED
D/CaptureSession( 1581): CameraCaptureSession.onReady() OPENED
W/System  ( 1581): A resource failed to call Surface.release. 
I/BpBinder( 1581): onLastStrongRef automatically unlinking death recipients: 
D/TransportRuntime.SQLiteEventStore( 1581): Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
D/TransportRuntime.JobInfoScheduler( 1581): Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
D/TransportRuntime.SQLiteEventStore( 1581): Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
D/TransportRuntime.JobInfoScheduler( 1581): Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
D/TransportRuntime.SQLiteEventStore( 1581): Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
D/TransportRuntime.JobInfoScheduler( 1581): Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
D/TransportRuntime.CctTransportBackend( 1581): Making request to: https://firebaselogging.googleapis.com/v0cc/log/batch?format=json_proto3
D/TrafficStats( 1581): tagSocket(154) with statsTag=0xffffffff, statsUid=-1
I/TransportRuntime.CctTransportBackend( 1581): Status Code: 200
I/TransportRuntime.CctTransportBackend( 1581): Content-Type: application/json; charset=UTF-8
I/TransportRuntime.CctTransportBackend( 1581): Content-Encoding: gzip
D/TransportRuntime.SQLiteEventStore( 1581): Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
D/TransportRuntime.JobInfoScheduler( 1581): Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
D/TransportRuntime.SQLiteEventStore( 1581): Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
D/TransportRuntime.JobInfoScheduler( 1581): Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
D/TransportRuntime.SQLiteEventStore( 1581): Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
D/TransportRuntime.JobInfoScheduler( 1581): Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...

@navaronbracke
Copy link
Collaborator

navaronbracke commented May 28, 2024

The following indicates you have an issue in your code, relating to the Hero tag of floating action buttons.
If you remove any of the offending floating action buttons from your app (commenting out for a test is fine) does the MobileScanner part work?

======== Exception caught by scheduler library =====================================================
The following assertion was thrown during a scheduler callback:
There are multiple heroes that share the same tag within a subtree.

Within each subtree for which heroes are to be animated (i.e. a PageRoute subtree), each Hero must have a unique non-null tag.
In this case, multiple heroes had the following tag: <default FloatingActionButton tag>
Here is the subtree for one of the offending heroes: Hero
  tag: <default FloatingActionButton tag>
  state: _HeroState#0e352

It seems your FloatingActionButton widgets all use the default hero tag, which is the cause of this error. Can you provide each with a separate Hero tag?

@tanvir93
Copy link
Author

tanvir93 commented May 28, 2024

Thanks for your follow-up. But I don't think that was the error related to the mobile scanner. With the same error, the mobile scanner works on all other Android versions (6.5 to 13), tested.

And on the mobile scanner screen, I don't have the floating action button. I have the floating action button in the previous screen, when you click on that button it takes you to the mobile scanner screen. Please, find the attachment, the camera opens as expected, but no barcode is captured/detected. I think the ML Kit part not working.

1716911237675

@navaronbracke
Copy link
Collaborator

navaronbracke commented May 31, 2024

In case of barcode errors, we do provide them as error events in the barcode stream from the native side, but we do not provide those details to users. I can look into forwarding these as error events in the stream of barcode events. (so that these show up in onError for listeners on the stream)

I added a note to the issue description to explain what I think might be happening.

@navaronbracke navaronbracke self-assigned this May 31, 2024
@navaronbracke navaronbracke added bug Something isn't working android Platform android MLKit labels May 31, 2024
@tanvir93
Copy link
Author

tanvir93 commented Jun 1, 2024

Thank you. I'll be waiting. My app get stucked for it and can't go to production without solving this.

@tanvir93
Copy link
Author

tanvir93 commented Jun 6, 2024

Hi @navaronbracke, do you have any recent plan to address this issue. I'm just stuck by it and waiting to release my app. Your co-operation will be greatly appreciated. Thanks in advance :)

@navaronbracke
Copy link
Collaborator

Hi @tanvir93, I can get started on adding this to the in-progress PR: #1086

That PR unified how we handled barcode errors in the plugin itself. On top of that, I will add some extra code to forward the barcode error events to the barcodesStream. Then you will be able to inspect what is happening.

I can do this in a relatively small timeframe (if I can spend the time working on it).
I am not sure if that will help if there are any underlying issues with MLKit relating to Android 14, as the Android release notes do not show any more recent versions of the library.

@tanvir93
Copy link
Author

tanvir93 commented Jun 8, 2024

Hi @navaronbracke, sounds good. Let's learn what is happining, first. And then we can plan to fix it. I'm waiting. Please, let me know you finish your part.

@tanvir93
Copy link
Author

Hi @navaronbracke, I tested the MLKit standalone. And it works on Android 14 as expected. So, I think there is a bug in mobile_scanner

ImportedPhoto_1717992437003

@navaronbracke
Copy link
Collaborator

@tanvir93 Good to know. Could you provide a minimal reproducible sample of the native Android project you used to test with?
If you could provide a link to a Github repo or a zip of the project, that would be perfect.

Then I can look into comparing the two to see what is wrong. In the meantime, I am still going to prepare the change to the MLKit error events, perhaps that also gives us a clue.

@tanvir93
Copy link
Author

Hi @navaronbracke, thanks for your follow up.

There you go: https://github.com/Apparence-io/CamerAwesome/blob/master/example/lib/preview_overlay_example.dart

I tried the MlKit with CameraAwesome following the above example. That works perfectly, withouht any modification.

I'm sorry to response back in a bit of late. I'm going through tight schedule.

@navaronbracke
Copy link
Collaborator

navaronbracke commented Jun 13, 2024

@tanvir93 I currently do not have an Android 14 device to test with.

However, I did look into the sample you provided and I have some observations:

TLDR: Either the image format (YUV vs NV21) or the configured ImageAnalysis options are the problem here.

  1. Both use com.google.mlkit.vision.barcode.BarcodeScanning as the barcode scanner implementation
    -> client is created via BarcodeScanning.getClient()
  1. Both create an com.google.mlkit.vision.common.InputImage as input for detection
  1. The image format usage has a slight different, but with the same outcome
  1. Both use the ImageAnalysis API to pass images to the scanner

@f1sh1918
Copy link

f1sh1918 commented Jun 26, 2024

We got reports that this happens on some devices with Android 14 (Samsung Galaxy A23 5g) but not on all
Using mobile_scanner 4.0.1

@navaronbracke
Copy link
Collaborator

@f1sh1918 Thanks for confirming that this is device specific. I do not have a Galaxy A24 available to test on, though.

Could you try testing out this patch on that device? #1086

That patch includes forwarding any of the MLKit error events that occur during scanning, as error events of the barcode stream. Inspecting the error events coming from the barcode stream would be very helpful.

If you see any errors come up in the stream, do post them here, so I can try and figure out why this is happening. I'd love to get this bug fixed, but I need to know what's going on first.

@f1sh1918
Copy link

f1sh1918 commented Jun 26, 2024

We just ordered this device to reproduce. Its not occurring on all android 14 devices which is good but even harder to debug.
I will let you know
We are in general facing some device specific flutter issues on android atm not only here (deeplinking, secure local storage)

Update:
Sorry it was the A23 5g. just updated my post

@arifinreinaldo
Copy link

Can confirm this issue also happen only in android 14,

Running pixel 7 with the selected android version also facing the same issue

@navaronbracke
Copy link
Collaborator

@arifinreinaldo Any chance you could try out the patch mentioned in #1077 (comment) and see if anything comes out of the error details on the stream?

@arifinreinaldo
Copy link

@arifinreinaldo Any chance you could try out the patch mentioned in #1077 (comment) and see if anything comes out of the error details on the stream?

Hi, I have tested this patch and I can see the camera scanning the barcode and QR code test case that I have

@navaronbracke
Copy link
Collaborator

@arifinreinaldo So that patch does work with Android 14? And you get no errors from the stream?

@f1sh1918 Do you see the same behavior? Or do you see errors in the stream?

@arifinreinaldo
Copy link

@arifinreinaldo So that patch does work with Android 14? And you get no errors from the stream?

@f1sh1918 Do you see the same behavior? Or do you see errors in the stream?

So far I don't see any error, but I also attach the log file in case I might miss something
scan_log.txt

@navaronbracke
Copy link
Collaborator

Sorry, I should have clarified better. With the new sample, if you do controller.barcodes.listen((data) {}, onError: (Object error){})

do you see anything in that onError ?

@arifinreinaldo
Copy link

Sorry, I should have clarified better. With the new sample, if you do controller.barcodes.listen((data) {}, onError: (Object error){})

do you see anything in that onError ?

Hi I have tried few times but I don't see from my testing. Thanks

@f1sh1918
Copy link

f1sh1918 commented Jul 1, 2024

It will take some time since the breaking changes from v4 to v5 for me to provide you some information

@f1sh1918
Copy link

f1sh1918 commented Jul 1, 2024

But the issue is related to that
#698
If you set a fixed camera resolution it works so it might be related to the specific camera of the device
cameraResolution: const Size(640, 480)

@arifinreinaldo
Copy link

will the fix merge with the this package @navaronbracke ?

@navaronbracke
Copy link
Collaborator

But the issue is related to that #698 If you set a fixed camera resolution it works so it might be related to the specific camera of the device cameraResolution: const Size(640, 480)

That indeed seems to be the workaround for this issue. Unfortunately since this is a bug with a specific device / camera combination, we cannot do much in the plugin.

@arifinreinaldo To answer your question, yes the plan is to land the patch relating to the onError handler. But as mentioned above, this does not solve the device specific bug.

@navaronbracke
Copy link
Collaborator

For easier tracking, and now that the root cause seems apparent, I am going to close this issue, in favor of #1116

Please comment on that issue if you have further comments / observations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android Platform android bug Something isn't working MLKit
Projects
None yet
Development

No branches or pull requests

4 participants