Problem
When a user taps the gallery icon and selects a saved image for barcode recognition on the custom barcode scanning UI, the app may exit unexpectedly.
Solution
The custom UI-based barcode scanning API and the API for recognizing barcodes from a saved image cannot be called concurrently.
When a user taps the gallery icon, call the stop and release APIs to stop and release the camera stream respectively, and then start saved image barcode recognition.