AmolGangadhare / flutter_barcode_scanner

Barcode scanner plugin for flutter. Supports barcode scanning for Android and iOS
https://pub.dev/packages/flutter_barcode_scanner
MIT License
380 stars 499 forks source link

Warning for AVCaptureSession startRunning on Main Thread #329

Open abdorizak opened 1 year ago

abdorizak commented 1 year ago

Dear @AmolGangadhare Describe the bug I encountered a warning in this barcode package related to the AVCaptureSession startRunning method being called on the main thread. The warning message advises that this method should ideally be called from a background thread to prevent potential UI unresponsiveness. -[AVCaptureSession startRunning] should be called from background thread. Calling it on the main thread can lead to UI unresponsiveness

To Reproduce 1- Integrate the Flutter barcode package into a Flutter application. 2- Utilize the package to initiate a barcode scanning process. 3- Observe the warning message related to AVCaptureSession startRunning being called on the main thread.

Expected behavior The AVCaptureSession startRunning method should be invoked from a background thread to avoid any potential UI unresponsiveness.

Screenshots

Screenshot 2023-09-23 at 8 37 32 PM

Additional context Flutter barcode package version: ^2.0.0 iOS version: iOS 17 Xcode version: Xcode 15

ohhyungkwon commented 7 months ago

Same here.