EddyVerbruggen / nativescript-bluetooth-demo

30 stars 21 forks source link

Android: Application crashes when tapping "Any Device" #7

Closed lhitc closed 8 years ago

lhitc commented 8 years ago

May be related to #6 :

com.tns.NativeScriptException: Calling js method onScanResult failed

TypeError: Cannot read property 'peripheralArray' of undefined File: "/data/data/org.nativescript.bluetoothdemo/files/app/tns_modules/nativescript-bluetooth/bluetooth.js, line: 502, column: 38

StackTrace: Frame: function:'Bluetooth._findPeripheral', file:'/data/data/org.nativescript.bluetoothdemo/files/app/tns_modules/nativescript-bluetooth/bluetooth.js', line: 502, column: 39 Frame: function:'android.bluetooth.le.ScanCallback.extend.onScanResult', file:'/data/data/org.nativescript.bluetoothdemo/files/app/tns_modules/nativescript-bluetooth/bluetooth.js', line: 81, column: 24

at com.tns.Platform.callJSMethodNative(Native Method) at com.tns.Platform.dispatchCallJSMethodNative(Platform.java:812) at com.tns.Platform.callJSMethod(Platform.java:711) at com.tns.Platform.callJSMethod(Platform.java:690) at com.tns.Platform.callJSMethod(Platform.java:680) at com.tns.gen.android.bluetooth.le.ScanCallback_ftns_modules_nativescript-bluetooth_bluetooth_l60_c60__.onScanResult(android.bluetooth.le.ScanCallback.java) at android.bluetooth.le.BluetoothLeScanner$BleScanCallbackWrapper$1.run(BluetoothLeScanner.java:355) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5466) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

EddyVerbruggen commented 8 years ago

Damn, let me find an Android 5/6 device and stop testing with those for now - this is just a silly copy-paste error I'll fix asap.

lhitc commented 8 years ago

Ok ;-)

EddyVerbruggen commented 8 years ago

Updating the plugin should fix this.