Code Monkey home page Code Monkey logo

Comments (13)

bmacdonald avatar bmacdonald commented on June 2, 2024 6

@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);

from nativescript-barcodescanner.

bradmartin avatar bradmartin commented on June 2, 2024 4

This will fix it #278 - the actual instance was undefined and was still getting passed the (!this._observer) check so it would crash when adding it. Fix tested and works on iOS 15 and NS 8.1. Demo app functioning in that PR confirmed.

from nativescript-barcodescanner.

grigala avatar grigala commented on June 2, 2024 4

@EddyVerbruggen any update on this one?

from nativescript-barcodescanner.

rob4226 avatar rob4226 commented on June 2, 2024 1

Yeah this is a known problem with NS v8.1. You can try the temporary hack:

const scanner =  new BarcodeScanner();
if (scanner['_observer']) {
  scanner['_observer']['_owner'] = undefined;
  scanner['_observer'] = undefined;
}
return scanner.scan(config);

from nativescript-barcodescanner.

rob4226 avatar rob4226 commented on June 2, 2024 1

@bradmartin Nice job!! Tried it and it seems to be working well now!

from nativescript-barcodescanner.

tdhman avatar tdhman commented on June 2, 2024

@bmacdonald Hello, I got the same issue on NS 8.1.0. How do you apply temporary fix for this issue ?

from nativescript-barcodescanner.

bmacdonald avatar bmacdonald commented on June 2, 2024

One more tidbit of information about the crash, it looks like it is only occurring on the phones and ipad pro. It does not seem to crash on regular ipads.

from nativescript-barcodescanner.

rob4226 avatar rob4226 commented on June 2, 2024

I'm also getting the same crash with NativeScript 8.1 on iPhone X iOS 14.

CONSOLE LOG: DEBUG_LOG: Creating barcode scanner...
====== Assertion failed ======
Native stack trace:
1          0x103cdc320 tns::Assert(bool, v8::Isolate*) + 128
2          0x103cfafe8 tns::Interop::WriteValue(v8::Local<v8::Context>, tns::TypeEncoding const*, void*, v8::Local<v8::Value>) + 5144
3          0x103cf9bac tns::Interop::SetFFIParams(v8::Local<v8::Context>, tns::TypeEncoding const*, tns::FFICall*, int, int, tns::V8Args&) + 120
4          0x103cf980c tns::Interop::CallFunctionInternal(tns::MethodCall&) + 356
5          0x103c6332c tns::ArgConverter::Invoke(v8::Local<v8::Context>, objc_class*, v8::Local<v8::Object>, tns::V8Args&, tns::MethodMeta const*, bool) + 780
6          0x103cb6bc8 tns::MetadataBuilder::InvokeMethod(v8::Local<v8::Context>, tns::MethodMeta const*, v8::Local<v8::Object>, tns::V8Args&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool) + 88
7          0x103cb6454 tns::MetadataBuilder::MethodCallback(v8::FunctionCallbackInfo<v8::Value> const&) + 220
8          0x103debe60 v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo) + 544
9          0x103deb360 v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<false>(v8::internal::Isolate*, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::FunctionTemplateInfo>, v8::internal::Handle<v8::internal::Object>, v8::internal::BuiltinArguments) + 524
10         0x103deaaf8 v8::internal::Builtin_Impl_HandleApiCall(v8::internal::BuiltinArguments, v8::internal::Isolate*) + 228
11         0x1044c63cc Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit + 108
12         0x10445f598 Builtins_InterpreterEntryTrampoline + 248
13         0x10445f598 Builtins_InterpreterEntryTrampoline + 248
14         0x10445f598 Builtins_InterpreterEntryTrampoline + 248
15         0x10445c578 construct_stub_create_deopt_addr + 344
16         0x10454f848 Builtins_ConstructHandler + 648
17         0x10445f598 Builtins_InterpreterEntryTrampoline + 248
// ...
72         0x10445f598 Builtins_InterpreterEntryTrampoline + 248
73         0x10445d36c Builtins_JSEntryTrampoline + 172
74         0x10445d004 Builtins_JSEntry + 164
75         0x103f37a70 v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) + 2532
76         0x103f37058 v8::internal::Execution::Call(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, int, v8::internal::Handle<v8::internal::Object>*) + 216
77         0x1040c2d14 v8::internal::Object::SetPropertyWithAccessor(v8::internal::LookupIterator*, v8::internal::Handle<v8::internal::Object>, v8::Maybe<v8::internal::ShouldThrow>) + 864
78         0x1040c6804 v8::internal::Object::SetPropertyInternal(v8::internal::LookupIterator*, v8::internal::Handle<v8::internal::Object>, v8::Maybe<v8::internal::ShouldThrow>, v8::internal::StoreOrigin, bool*) + 420
79         0x1040c6584 v8::internal::Object::SetProperty(v8::internal::LookupIterator*, v8::internal::Handle<v8::internal::Object>, v8::internal::StoreOrigin, v8::Maybe<v8::internal::ShouldThrow>) + 80
80         0x103faab54 v8::internal::StoreIC::Store(v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Name>, v8::internal::Handle<v8::internal::Object>, v8::internal::StoreOrigin) + 1188
81         0x103fafc04 v8::internal::Runtime_StoreIC_Miss(int, unsigned long*, v8::internal::Isolate*) + 320
82         0x1044c628c Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_NoBuiltinExit + 108
83         0x1045468f4 Builtins_StaNamedPropertyHandler + 148
84         0x10445f598 Builtins_InterpreterEntryTrampoline + 248
85         0x10445f598 Builtins_InterpreterEntryTrampoline + 248
86         0x10445d36c Builtins_JSEntryTrampoline + 172
87         0x10445d004 Builtins_JSEntry + 164
88         0x103f37a70 v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) + 2532
89         0x103f37058 v8::internal::Execution::Call(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, int, v8::internal::Handle<v8::internal::Object>*) + 216
90         0x103d8a50c v8::Function::Call(v8::Local<v8::Context>, v8::Local<v8::Value>, int, v8::Local<v8::Value>*) + 448
91         0x103c64794 tns::ArgConverter::MethodCallback(ffi_cif*, void*, void**, void*) + 1164
92         0x103d57974 ffi_closure_SYSV_inner + 800
93         0x103d581b4 .Ldo_closure + 20
114        0x18f25c018 <redacted> + 768
115        0x18f25b7d0 CFRunLoopRunSpecific + 572
116        0x1a599d570 GSEventRunModal + 160
117        0x191b882d0 <redacted> + 1052
118        0x191b8d84c UIApplicationMain + 164
119        0x103d58044 ffi_call_SYSV + 68
120        0x103d571d8 ffi_call_int + 968
121        0x103cf9854 tns::Interop::CallFunctionInternal(tns::MethodCall&) + 428
122        0x103cbbb9c std::__1::__function::__func<tns::MetadataBuilder::CFunctionCallback(v8::FunctionCallbackInfo<v8::Value> const&)::$_2, std::__1::allocator<tns::MetadataBuilder::CFunctionCallback(v8::FunctionCallbackInfo<v8::Value> const&)::$_2>, void ()>::operator()() + 564
123        0x103d1ce68 tns::Tasks::Drain() + 104
124        0x103d17088 +[NativeScript start:] + 572
125        0x102d6e900 125 mobile                              0x0000000102d6e900 mobile + 26880
126        0x18ef3a140 <redacted> + 4
JavaScript stack trace:
at _addVolumeObserver (file: src/webpack:/mobile/node_modules/nativescript-barcodescanner/barcodescanner.ios.js:96:0)
at <anonymous> (file: src/webpack:/mobile/node_modules/nativescript-barcodescanner/barcodescanner.ios.js:178:0)
at new ZoneAwarePromise (file: src/webpack:/mobile/node_modules/zone.js/fesm2015/zone.js:1387:0)
at scan (file: src/webpack:/mobile/node_modules/nativescript-barcodescanner/barcodescanner.ios.js:169:0)
at createBarcodeScanner (file: src/webpack:/mobile/src/app/modules/scanner/barcode-scanner/barcode-scanner.component.ts:121:7)
at <anonymous> (file: src/webpack:/mobile/src/app/modules/scanner/barcode-scanner/barcode-scanner.component.ts:59:15)
at <anonymous> (file: src/webpack:/mobile/node_modules/rxjs/dist/cjs/internal/Subscriber.js:161:0)
at exports.modules../node_modules/rxjs/dist/cjs/internal/Subscriber.js.Subscriber._next (file: src/webpack:/mobile/node_modules/rxjs/dist/cjs/internal/Subscriber.js:101:0)
at exports.modules../node_modules/rxjs/dist/cjs/internal/Subscriber.js.Subscriber.next (file: src/webpack:/mobile/node_modules/rxjs/dist/cjs/internal/Subscriber.js:72:0)
at exports.modules../node_modules/rxjs/dist/cjs/internal/BehaviorSubject.js.BehaviorSubject._subscribe (file: src/webpack:/mobile/node_modules/rxjs/dist/cjs/internal/BehaviorSubject.js:36:0)

from nativescript-barcodescanner.

LaKing avatar LaKing commented on June 2, 2024

Same issue as #275

I updated all versions meanwhile, but still the same.

✔ Xcode is installed and is configured properly.
✔ xcodeproj is installed and is configured properly.
✔ CocoaPods are installed.
✔ CocoaPods update is not required.
✔ CocoaPods are configured properly.
✔ Your current CocoaPods version is newer than 1.0.0.
✔ Python installed and configured correctly.
✔ The Python 'six' package is found.
✔ Xcode version 13.0.0 satisfies minimum required version 10.
✔ Getting NativeScript components versions information...
✔ Component nativescript has 8.1.2 version and is up to date.
✔ Component @nativescript/core has 8.1.3 version and is up to date.
✔ Component @nativescript/ios has 8.1.0 version and is up to date.

from nativescript-barcodescanner.

LaKing avatar LaKing commented on June 2, 2024

Yes, thank you @rob4226 , that workaround works.

from nativescript-barcodescanner.

eikaramba avatar eikaramba commented on June 2, 2024

would be great if this can be merged

from nativescript-barcodescanner.

grigala avatar grigala commented on June 2, 2024

@eikaramba given the activity record of Eddy lately, I doubt anything would change in this repo anytime soon.

You need to pull the same plugin from @nstudio namespace - @nstudio/nativescript-barcodescanner which is up-to date and includes the solution of this problem.

from nativescript-barcodescanner.

eikaramba avatar eikaramba commented on June 2, 2024

Thanks for the tip!

from nativescript-barcodescanner.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.