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

bug: Camera opening error #187

Open
5 of 11 tasks
ilsanto17 opened this issue Sep 23, 2024 · 3 comments
Open
5 of 11 tasks

bug: Camera opening error #187

ilsanto17 opened this issue Sep 23, 2024 · 3 comments

Comments

@ilsanto17
Copy link

ilsanto17 commented Sep 23, 2024

Plugin(s)

  • Barcode Scanning
  • Face Detection
  • Face Mesh Detection
  • Selfie Segmentation
  • Translation

Version

6.1.0

Platform(s)

  • Android
  • iOS
  • Web

Current behavior

When I click on the button to open the camera in iOS, after asking for permissions, I get the error I attach below. The camera does not open. On Android it works perfectly

startScan = async () => {
    try {
      document.querySelector('body')?.classList.add('barcode-scanner-active');

      // Usa NgZone per eseguire il codice fuori dal ciclo di rilevamento del cambiamento di Angular
      this.zone.runOutsideAngular(async () => {
        const listener = await BarcodeScanner.addListener('barcodeScanned', async result => {
          console.log("Barcode scanned:", result);
        });

        await BarcodeScanner.startScan();
      });
    } catch (error) {
      console.error("Error during scan:", error);
    }
  };
startScan = async () => {
    try {
      document.querySelector('body')?.classList.add('barcode-scanner-active');

      // Usa NgZone per eseguire il codice fuori dal ciclo di rilevamento del cambiamento di Angular
      this.zone.runOutsideAngular(async () => {
        const listener = await BarcodeScanner.addListener('barcodeScanned', async result => {
          console.log("Barcode scanned:", result);
        });

        await BarcodeScanner.startScan();
      });
    } catch (error) {
      console.error("Error during scan:", error);
    }
  };
To Native ->  BarcodeScanner addListener 107025623
⚡️  To Native ->  BarcodeScanner startScan 107025624
Thread Performance Checker: -[AVCaptureSession startRunning] should be called from background thread. Calling it on the main thread can lead to UI unresponsiveness
PID: 1804, TID: 248741
Backtrace
=================================================================
3   CapacitorCommunityBarcodeScanner    0x0000000103b58ed8 $s32CapacitorCommunityBarcodeScanner0cD0C4scan33_E9781981B91FA2D5C67BE1318BC971C3LLyyFyyScMYccfU1_ + 484
4   CapacitorCommunityBarcodeScanner    0x0000000103b577c8 $sIeg_IeyB_TR + 48
5   libdispatch.dylib                   0x000000010448cb98 _dispatch_call_block_and_release + 32
6   libdispatch.dylib                   0x000000010448e7bc _dispatch_client_callout + 20
7   libdispatch.dylib                   0x000000010449ed58 _dispatch_main_queue_drain + 1084
8   libdispatch.dylib                   0x000000010449e90c _dispatch_main_queue_callback_4CF + 44
9   CoreFoundation                      0x000000019e17b710 76A3B198-3C09-323E-8359-0D4978E156F5 + 354064
10  CoreFoundation                      0x000000019e178914 76A3B198-3C09-323E-8359-0D4978E156F5 + 342292
11  CoreFoundation                      0x000000019e177cd8 CFRunLoopRunSpecific + 608
12  GraphicsServices                    0x00000001e2bc51a8 GSEventRunModal + 164
13  UIKitCore                           0x00000001a07b1ae8 9DA0D273-5506-3712-B73D-E0149D74C13C + 4238056
14  UIKitCore                           0x00000001a0865d98 UIApplicationMain + 340
15  App.debug.dylib                     0x0000000104dccf84 __debug_main_executable_dylib_entry_point + 64
16  dyld                                0x00000001c194f154 52039C94-4DA1-3638-BD52-020A0B5FA399 + 250196
⚡️  To Native ->  BarcodeScanner addListener 107025625
⚡️  To Native ->  BarcodeScanner startScan 107025626

Expected behavior

Camera opening

Reproduction

.

Steps to reproduce

.

Other information

No response

Capacitor doctor

Capacitor Doctor 💊

Latest Dependencies:

@capacitor/cli: 6.1.2
@capacitor/core: 6.1.2
@capacitor/android: 6.1.2
@capacitor/ios: 6.1.2

Installed Dependencies:

@capacitor/cli: 6.1.2
@capacitor/android: 5.5.0
@capacitor/core: 6.1.2
@capacitor/ios: 6.1.2

[success] iOS looking great! 👌
[success] Android looking great! 👌

Before submitting

  • I have read and followed the bug report guidelines.
  • I have attached links to possibly related issues and discussions.
  • I understand that incomplete issues (e.g. without reproduction) are closed.
Copy link
Contributor

This issue has been labeled as needs: reproduction. This label is added to issues that need a code reproduction.

Please provide a Minimal, Reproducible Example using this template in a public GitHub repository so we can debug the issue.

If you have already provided a code snippet and are seeing this message, it is likely that the code snippet was not enough for us to reproduce the issue.

@spSystango

This comment was marked as off-topic.

@robingenz

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants