-
Couldn't load subscription status.
- Fork 3k
Open
Description
Describe the bug
When Kotlin delegation is used as following:
class BarcodeScanningAnalyzer internal constructor(
mlKitAnalyzer: MlKitAnalyzer, val executor: Executor, barcodeScanner: BarcodeScanner
) : ImageAnalysis.Analyzer by mlKitAnalyzer, LifecycleObserver by barcodeScanner {
}and later scanning started via:
cameraController.setImageAnalysisAnalyzer(analyzer.executor, analyzer)No scanning is happening (consumer is never called back).
However when I change the delegation to the direct inheritance of the MlKitAnalyzer - then scanning works as expected:
class BarcodeScanningAnalyzer internal constructor(
barcodeScanner: BarcodeScanner, val executor: Executor, consumer: Consumer<Result>
) : MlKitAnalyzer(
listOf<BarcodeScanner>(barcodeScanner),
/* provides ability drawing easily a overlay/box around the QR Code in real time */
COORDINATE_SYSTEM_VIEW_REFERENCED,
executor,
consumer
), LifecycleObserver by barcodeScannerSDK Info:
- SDK Name & Version: com.google.mlkit:barcode-scanning:17.0.2
Smartphone:
- Device/Simulator: Pixel 9 Pro
- Device/Simulator OS: Android 15
Development Environment:
IDE: Android Studio Meerkat | 2024.3.1 Canary 4
Metadata
Metadata
Assignees
Labels
No labels