nativescript-community / nativescript-community/ble

Connect causes Fatal JavaScript exception on iOS. Works fine on Android

Open
#215 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
202
Forks
79
PR merge metrics
No merged PRs in 30d

Description

After upgrade from old NativeScript-bluetooth to @nativescript-community/ble I cannot connect to device from iOS (14). Scanning works find and the device is found, but in the connect-call I get. I realise this has something to do with our project setup, but can anyone point us in the right direction?: Besides version 3.0.16, I have also tried 3.0.9 and 3.0.0 - with identical results.

21-04-15 15:48:32.060135+0200 triplyui[2392:639104] ***** Fatal JavaScript exception - application has been terminated. *****
2021-04-15 15:48:32.060446+0200 triplyui[2392:639104] Native stack trace:
2021-04-15 15:48:32.060794+0200 triplyui[2392:639104] 1   0x1059e2348 NativeScript::reportFatalErrorBeforeShutdown(JSC::ExecState*, JSC::Exception*, bool)
1   0x1059e2348 NativeScript::reportFatalErrorBeforeShutdown(JSC::ExecState*, JSC::Exception*, bool)
2021-04-15 15:48:32.061231+0200 triplyui[2392:639104] 2   0x105a1c434 NativeScript::FFICallback<NativeScript::ObjCMethodCallback>::ffiClosureCallback(ffi_cif*, void*, void**, void*)
2   0x105a1c434 NativeScript::FFICallback<NativeScript::ObjCMethodCallback>::ffiClosureCallback(ffi_cif*, void*, void**, void*)
2021-04-15 15:48:32.061542+0200 triplyui[2392:639104] 3   0x106587388 ffi_closure_SYSV_inner
3   0x106587388 ffi_closure_SYSV_inner
2021-04-15 15:48:32.061822+0200 triplyui[2392:639104] 4   0x1065881b4 .Ldo_closure
4   0x1065881b4 .Ldo_closure
2021-04-15 15:48:32.061971+0200 triplyui[2392:639104] 5   0x1b28f8708 <redacted>
5   0x1b28f8708 <redacted>
2021-04-15 15:48:32.062082+0200 triplyui[2392:639104] 6   0x1b28f5354 <redacted>
6   0x1b28f5354 <redacted>
2021-04-15 15:48:32.062181+0200 triplyui[2392:639104] 7   0x1b28ea584 <redacted>
7   0x1b28ea584 <redacted>
2021-04-15 15:48:32.062288+0200 triplyui[2392:639104] 8   0x1b2911a2c <redacted>
8   0x1b2911a2c <redacted>
2021-04-15 15:48:32.062391+0200 triplyui[2392:639104] 9   0x1b2905754 <redacted>
9   0x1b2905754 <redacted>
2021-04-15 15:48:32.062494+0200 triplyui[2392:639104] 10  0x106b5fbcc _dispatch_call_block_and_release
10  0x106b5fbcc _dispatch_call_block_and_release
2021-04-15 15:48:32.062596+0200 triplyui[2392:639104] 11  0x106b616c0 _dispatch_client_callout
11  0x106b616c0 _dispatch_client_callout
2021-04-15 15:48:32.062881+0200 triplyui[2392:639104] 12  0x106b69354 _dispatch_lane_serial_drain
12  0x106b69354 _dispatch_lane_serial_drain
2021-04-15 15:48:32.062995+0200 triplyui[2392:639104] 13  0x106b6a0f4 _dispatch_lane_invoke
13  0x106b6a0f4 _dispatch_lane_invoke
2021-04-15 15:48:32.063095+0200 triplyui[2392:639104] 14  0x106b70d7c _dispatch_main_queue_callback_4CF
14  0x106b70d7c _dispatch_main_queue_callback_4CF
2021-04-15 15:48:32.063259+0200 triplyui[2392:639104] 15  0x198c0d11c <redacted>
15  0x198c0d11c <redacted>
2021-04-15 15:48:32.063437+0200 triplyui[2392:639104] 16  0x198c07120 <redacted>
16  0x198c07120 <redacted>
2021-04-15 15:48:32.063730+0200 triplyui[2392:639104] 17  0x198c0621c CFRunLoopRunSpecific
17  0x198c0621c CFRunLoopRunSpecific
2021-04-15 15:48:32.063989+0200 triplyui[2392:639104] 18  0x1b07d0784 GSEventRunModal
18  0x1b07d0784 GSEventRunModal
2021-04-15 15:48:32.064670+0200 triplyui[2392:639104] 19  0x19b646ee8 <redacted>
19  0x19b646ee8 <redacted>
2021-04-15 15:48:32.065469+0200 triplyui[2392:639104] 20  0x19b64c75c UIApplicationMain
20  0x19b64c75c UIApplicationMain
2021-04-15 15:48:32.065719+0200 triplyui[2392:639104] 21  0x106588044 ffi_call_SYSV
21  0x106588044 ffi_call_SYSV
2021-04-15 15:48:32.065924+0200 triplyui[2392:639104] 22  0x106586ae8 ffi_call_int
22  0x106586ae8 ffi_call_int
2021-04-15 15:48:32.066137+0200 triplyui[2392:639104] 23  0x106586648 ffi_call
23  0x106586648 ffi_call
2021-04-15 15:48:32.066329+0200 triplyui[2392:639104] 24  0x1059a53d8 NativeScript::FunctionWrapper::call(JSC::ExecState*)
24  0x1059a53d8 NativeScript::FunctionWrapper::call(JSC::ExecState*)
2021-04-15 15:48:32.066559+0200 triplyui[2392:639104] 25  0x106553b10 llint_entry
25  0x106553b10 llint_entry
2021-04-15 15:48:32.066808+0200 triplyui[2392:639104] 26  0x106550f28 llint_entry
26  0x106550f28 llint_entry
2021-04-15 15:48:32.067026+0200 triplyui[2392:639104] 27  0x106550f28 llint_entry
27  0x106550f28 llint_entry
2021-04-15 15:48:32.067231+0200 triplyui[2392:639104] 28  0x106550f28 llint_entry
28  0x106550f28 llint_entry
2021-04-15 15:48:32.067431+0200 triplyui[2392:639104] 29  0x106550f28 llint_entry
29  0x106550f28 llint_entry
2021-04-15 15:48:32.067620+0200 triplyui[2392:639104] 30  0x106550f28 llint_entry
30  0x106550f28 llint_entry
2021-04-15 15:48:32.067815+0200 triplyui[2392:639104] 31  0x106550f28 llint_entry
31  0x106550f28 llint_entry
2021-04-15 15:48:32.067966+0200 triplyui[2392:639104] JavaScript stack trace:
2021-04-15 15:48:32.068155+0200 triplyui[2392:639104] peripheralDidDiscoverServices(file:///app/vendor.js:86221:134)
at file:///app/vendor.js:85076:48
at forEach([native code])
at file:///app/vendor.js:85074:34
at UIApplicationMain([native code])
at run(file:///app/vendor.js:94808:26)
at file:///app/vendor.js:89054:26
at file:///app/vendor.js:88955:38
at file:///app/vendor.js:88935:26
at file:///app/bundle.js:4355:144
at ./main.tns.ts(file:///app/bundle.js:4360:34)
at __webpack_require__(file:///app/runtime.js:754:34)
at checkDeferredModules(file:///app/runtime.js:44:42)
at webpackJsonpCallback(file:///app/runtime.js:31:39)
at anonymous(file:///app/bundle.js:2:61)
at evaluate([native code])
at moduleEvaluation([native code])
at [native code]
at asyncFunctionResume([native code])
at [native code]
at promiseReactionJob([native code])
2021-04-15 15:48:32.068278+0200 triplyui[2392:639104] JavaScript error:
2021-04-15 15:48:32.068435+0200 triplyui[2392:639104] file:///app/vendor.js:86221:134: JS ERROR TypeError: undefined is not an object (evaluating '_nativescript_core_utils_native_helper__WEBPACK_IMPORTED_MODULE_2__["iOSNativeHelper"].collections')

file:///app/vendor.js:86221:134: JS ERROR TypeError: undefined is not an object (evaluating '_nativescript_core_utils_native_helper__WEBPACK_IMPORTED_MODULE_2__["iOSNativeHelper"].collections')
2021-04-15 15:48:32.071352+0200 triplyui[2392:639104] *** JavaScript call stack:
(
	0   UIApplicationMain@[native code]
	1   run@file:///app/vendor.js:94808:26
	2   @file:///app/vendor.js:89054:26
	3   @file:///app/vendor.js:88955:38
	4   @file:///app/vendor.js:88935:26
	5   @file:///app/bundle.js:4355:144
	6   ./main.tns.ts@file:///app/bundle.js:4360:34
	7   __webpack_require__@file:///app/runtime.js:754:34
	8   checkDeferredModules@file:///app/runtime.js:44:42
	9   webpackJsonpCallback@file:///app/runtime.js:31:39
	10  anonymous@file:///app/bundle.js:2:61
	11  evaluate@[native code]
	12  moduleEvaluation@:1:11
	13  @:2:1
	14  asyncFunctionResume@:1:11
	15  @:24:9
	16  promiseReactionJob@:1:11
)
2021-04-15 15:48:32.071602+0200 triplyui[2392:639104] *** Terminating app due to uncaught exception 'NativeScript encountered a fatal error: TypeError: undefined is not an object (evaluating '_nativescript_core_utils_native_helper__WEBPACK_IMPORTED_MODULE_2__["iOSNativeHelper"].collections')
 at 
peripheralDidDiscoverServices(file:///app/vendor.js:86221:134)
at file:///app/vendor.js:85076:48
at forEach([native code])
at file:///app/vendor.js:85074:34
at UIApplicationMain([native code])
at run(file:///app/vendor.js:94808:26)
at file:///app/vendor.js:89054:26
at file:///app/vendor.js:88955:38
at file:///app/vendor.js:88935:26
at file:///app/bundle.js:4355:144
at ./main.tns.ts(file:///app/bundle.js:4360:34)
at __webpack_require__(file:///app/runtime.js:754:34)
at checkDeferredModules(file:///app/runtime.js:44:42)
at webpackJsonpCallback(file:///app/runtime.js:31:39)
at anonymous(file:///app/bundle.js:2:61)
at evaluate([native code])
at moduleEvaluation([native code])
at [native code]
at asyncFunctionResume([native code])
at [native code]
at promiseReactionJob([native code])
', reason: '(null)'
*** First throw call stack:
(0x198c9186c 0x1adcaac50 0x1059e2820 0x105a1c434 0x106587388 0x1065881b4 0x1b28f8708 0x1b28f5354 0x1b28ea584 0x1b2911a2c 0x1b2905754 0x106b5fbcc 0x106b616c0 0x106b69354 0x106b6a0f4 0x106b70d7c 0x198c0d11c 0x198c07120 0x198c0621c 0x1b07d0784 0x19b646ee8 0x19b64c75c 0x106588044 0x106586ae8 0x106586648 0x1059a53d8 0x106553b10 0x106550f28 0x106550f28 0x106550f28 0x106550f28 0x106550f28 0x106550f28 0x106550f28 0x106550f28 0x106550e80 0x106550f28 0x1065325e8 0x105ae0e48 0x106384cb4 0x1059bd8f4 0x1062559d0 0x1065537cc 0x106550f28 0x106550f28 0x106550f28 0x106550e80 0x106550f28 0x1065325e8 0x105ae0e48 0x106384e50 0x10624ed9c 0x1059b3304 0x105a2c350 0x104f5db28 0x1988c66b0)
libc++abi.dylib: terminating with uncaught exception of type NSException
*** Terminating app due to uncaught exception 'NativeScript encountered a fatal error: TypeError: undefined is not an object (evaluating '_nativescript_core_utils_native_helper__WEBPACK_IMPORTED_MODULE_2__["iOSNativeHelper"].collections')
 at 
peripheralDidDiscoverServices(file:///app/vendor.js:86221:134)
at file:///app/vendor.js:85076:48
at forEach([native code])
at file:///app/vendor.js:85074:34
at UIApplicationMain([native code])
at run(file:///app/vendor.js:94808:26)
at file:///app/vendor.js:89054:26
at file:///app/vendor.js:88955:38
at file:///app/vendor.js:88935:26
at file:///app/bundle.js:4355:144
at ./main.tns.ts(file:///app/bundle.js:4360:34)
at __webpack_require__(file:///app/runtime.js:754:34)
at checkDeferredModules(file:///app/runtime.js:44:42)
at webpackJsonpCallback(file:///app/runtime.js:31:39)
at anonymous(file:///app/bundle.js:2:61)
at evaluate([native code])
at moduleEvaluation([native code])
at [native code]
at asyncFunctionResume([native code])
at [native code]
at promiseReactionJob([native code])
', reason: '(null)'
terminating with uncaught exception of type NSException

my package.json deps:

"dependencies": {
    "@angular/animations": "~8.2.0",
    "@angular/common": "~8.2.0",
    "@angular/compiler": "~8.2.0",
    "@angular/core": "~8.2.0",
    "@angular/forms": "~8.2.0",
    "@angular/http": "~8.0.0-beta.10",
    "@angular/platform-browser": "~8.2.0",
    "@angular/platform-browser-dynamic": "~8.2.0",
    "@angular/router": "~8.2.0",
    "@nativescript-community/ble": "^3.0.16",
    "@proplugins/nativescript-localstorage": "^2.3.1",
    "css-loader": "^3.2.0",
    "nativescript-angular": "^8.20.1",
    "nativescript-datetimepicker": "^1.2.3",
    "nativescript-directions": "^1.3.1",
    "nativescript-geolocation": "^5.1.0",
    "nativescript-ngx-shadow": "^6.5.0",
    "nativescript-permissions": "^1.3.9",
    "nativescript-theme-core": "^1.0.6",
    "nativescript-ui-gauge": "^5.0.0",
    "reflect-metadata": "~0.1.12",
    "rxjs": "^6.4.0",
    "rxjs-compat": "^6.0.0-rc.0",
    "tns-core-modules": "^6.5.27",
    "tslib": "^1.11.2",
    "zone.js": "^0.9.1"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^0.803.26",
    "@angular/cli": "^8.3.26",
    "@angular/compiler-cli": "~8.2.0",
    "@angular/language-service": "^8.2.6",
    "@nativescript/schematics": "~0.7.0",
    "@nativescript/tslint-rules": "~0.0.2",
    "@types/jasmine": "~2.8.3",
    "@types/jasminewd2": "~2.0.2",
    "@types/node": "^10.17.21",
    "codelyzer": "^5.2.2",
    "jasmine-core": "~2.8.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "^4.3.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "^1.2.1",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "nativescript-dev-webpack": "^1.5.1",
    "protractor": "^6.0.0",
    "style-loader": "^1.2.1",
    "tns-android": "6.5.3",
    "tns-ios": "6.5.4",
    "tns-platform-declarations": "^6.5.1",
    "ts-node": "~4.1.0",
    "tslint": "~5.9.1",
    "typescript": "~3.5.3"

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the iOS connect failure and inspect the peripheralDidDiscoverServices stack entry in vendor.js, along with the application entry in main.tns.ts and the listed package versions. Compare the iOS and Android behavior and verify whether the connection completes without the fatal exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, angular, ios, typescript
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.