question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Invoking barcode scanner causes application crash on latest NativeScript ios platform (8.1.0)

See original GitHub issue

When the barcode scanner is invoked, the application crashes on ios with the latest nativescript runtime.

NativeScript Info

✔ Component nativescript has 8.1.1 version and is up to date. ✔ Component @nativescript/core has 8.1.1 version and is up to date. ✔ Component @nativescript/ios has 8.1.0 version and is up to date.

Steps

  • Create an example application with the barcode scanner implemented.
  • configure beepOnScan to false.
  • Invoke the barcode scanner.

The crash has something to do with the _addVolumeObserver.

Stack

2021-09-10 14:08:28.074065-0400 someapp[844:112105] 58 0x101978e68 tns::Tasks::Drain() + 104 2021-09-10 14:08:28.074274-0400 someapp[844:112105] 59 0x101973088 +[NativeScript start:] + 572 2021-09-10 14:08:28.074308-0400 someapp[844:112105] 60 0x100e877a0 main + 676 2021-09-10 14:08:28.074339-0400 someapp[844:112105] 61 0x186469cf8 <redacted> + 4 2021-09-10 14:08:28.074359-0400 someapp[844:112105] JavaScript stack trace: 2021-09-10 14:08:28.103018-0400 someapp[844:112105] at _addVolumeObserver (file:///app/vendor.js:146876:32)

Temporary fix:

        if (scanner['_observer']) {
            scanner['_observer']['_owner'] = undefined;
            scanner['_observer'] = undefined;
        }

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:13

github_iconTop GitHub Comments

5reactions
bmacdonaldcommented, Sep 14, 2021

@tdhman It’s pretty gross and I am not proud of it, but you need to configure beepOnScan = false. Then create an instance of the barcode scanner class. Apply the properties to the class. I am using an angular service which wraps the scanner, but you don’t have to do that. The reason it works is because there is an _addVolumeObserver method which will return if there is no _observer. This is intended to be a temporary hack. Hopefully, @EddyVerbruggen can possibly take a look.

        config.beepOnScan = false;
        const scanner =  new BarcodeScanner();
        if (scanner['_observer']) {
            scanner['_observer']['_owner'] = undefined;
            scanner['_observer'] = undefined;
        }
        return scanner.scan(config);
4reactions
grigalacommented, Nov 1, 2021

@EddyVerbruggen any update on this one?

Read more comments on GitHub >

github_iconTop Results From Across the Web

nativescript-barcodescanner
When the barcode scanner is invoked, the application crashes on ios with the latest nativescript runtime. NativeScript Info.
Read more >
App Crash Issue in IOS 14.0 | Apple Developer Forums
We did submit our app for review and received a crash report but we have checked in Multiple IOS 14 devices, the APP...
Read more >
nativescript/CHANGELOG.md
In 6.0 this is the default and only behavior - webpack watches all required files and CLI watches the `platforms` directories and `package.json`...
Read more >
nstudio/nativescript-barcodescanner
Embedding the scanner (iOS). If you need to embed the scanner for Android as well, please consider using the Machine Learning powered Barcode...
Read more >
http failure response for unknown error
You.com is an ad-free, private search engine that you control. Customize search results with 150 apps alongside web results. Access a zero-trace private ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found