Comments (13)
@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.
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.
@EddyVerbruggen any update on this one?
from nativescript-barcodescanner.
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.
@bradmartin Nice job!! Tried it and it seems to be working well now!
from nativescript-barcodescanner.
@bmacdonald Hello, I got the same issue on NS 8.1.0. How do you apply temporary fix for this issue ?
from nativescript-barcodescanner.
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.
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.
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.
Yes, thank you @rob4226 , that workaround works.
from nativescript-barcodescanner.
would be great if this can be merged
from nativescript-barcodescanner.
@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.
Thanks for the tip!
from nativescript-barcodescanner.
Related Issues (20)
- Scanned QR code does not update property HOT 1
- Creating Dialog.alert inside .then((result) not working HOT 5
- class definition conflicts HOT 1
- can it scan a qr picture saved in storage?
- options to avoid page reloading upon scanning HOT 1
- [iOS] Crash with NativeScript 8 and JSC runtime HOT 1
- Crashes Android app on NS8 HOT 7
- Preview on iOS fails with JS exception which crashes the app.
- "The webpack configuration file ...webpack.config.js does not exist" while trying demo HOT 1
- warning: skipping copy phase strip, binary is code signed HOT 1
- Objective-C class name "UIScrollViewDelegateImpl" is already in use - using "UIScrollViewDelegateImpl1" instead.
- Opening the camera for a barcode scan crashes the app on iOS HOT 3
- Scanning with a scanner HOT 2
- Add Button in Activity Scanner Android
- Error: Command xcodebuild failed with exit code 65 on Apple Silicon (M1) HOT 3
- Crash all Frames in application after a scan done! HOT 1
- Can this plugin pick QR from image?
- Build target issue: iOS vs iOS + iOS Simulator HOT 2
- Crash at startup on Android in release mode HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nativescript-barcodescanner.