don / cordova-plugin-ble-central

Bluetooth Low Energy (BLE) Central plugin for Apache Cordova (aka PhoneGap)
Apache License 2.0
941 stars 601 forks source link

App crashing while giving authorise and post notification permission accept - android 12 & 13, SDK 33 #992

Closed sivakavi-manurevasolutions closed 6 months ago

sivakavi-manurevasolutions commented 7 months ago

I am facing app crash while user give authorise and post notification permission accept.

compileSdkVersion = 33 targetSdkVersion = 33

Platforms - Android 12 & 13

"dependencies": { "@angular/common": "^8.2.14", "@angular/core": "^8.2.14", "@angular/forms": "^8.2.14", "@angular/platform-browser": "^8.2.14", "@angular/platform-browser-dynamic": "^8.2.14", "@angular/pwa": "^0.803.23", "@angular/router": "^8.2.14", "@angular/service-worker": "^8.2.14", "@capacitor/core": "2.4.7", "@ionic-native/ble": "^5.31.1", "@ionic-native/core": "5.0.0-beta.15", "@ionic-native/deeplinks": "^5.36.0", "@ionic-native/diagnostic": "^5.33.0", "@ionic-native/geolocation": "^5.31.1", "@ionic-native/in-app-browser": "5.0.0-beta.15", "@ionic-native/ionic-webview": "^5.33.1", "@ionic-native/location-accuracy": "^5.33.0", "@ionic-native/qr-scanner": "^5.31.1", "@ionic-native/splash-screen": "5.0.0-beta.15", "@ionic-native/status-bar": "5.0.0-beta.15", "@ionic/angular": "^5.1.1", "@ionic/storage": "2.2.0", "cordova-plugin-add-swift-support": "^2.0.2", "cordova-plugin-device": "^2.0.3", "cordova-plugin-geolocation": "^4.1.0", "cordova-plugin-ionic-keyboard": "^2.2.0",

"cordova-plugin-request-location-accuracy": "^2.3.0", "cordova-plugin-splashscreen": "^5.0.3", "cordova-plugin-statusbar": "^2.4.3", "cordova-res": "^0.15.3", "cordova.plugins.diagnostic": "^4.0.12", "core-js": "^3.6.4", "flag": "^5.0.1", "ionic-plugin-deeplinks": "^1.0.22", "ios-deploy": "^1.11.4", "jquery": "^3.6.0", "moment": "^2.10.2", "ng2-pdf-viewer": "6.4.1", "remove": "^0.1.5", "rxjs": "^6.5.4", "rxjs-compat": "^6.6.6", "sharp": "^0.28.3", "sw-toolbox": "3.6.0", "sweetalert": "^2.1.2", "sweetalert2": "^10.16.7", "tslib": "^1.10.0", "yes": "^1.1.1", "zone.js": "~0.9.1" },

peitschie commented 7 months ago

Hi @sivakavi-manurevasolutions

Can you confirm which version of cordova and cordova-android you have installed? Some of those cordova plugins there look quite outdated, and it's possible your setup is not supported by this plugin.

Do you have stack traces of the crash?

sivakavi-manurevasolutions commented 7 months ago

Thanks for the Reply @peitschie. cordova : 12.0.0 Installed platforms: android 10.1.2 ios 6.3.0

Will share the stack traces.

sivakavi-manurevasolutions commented 7 months ago

Failure delivering result ResultInfo{who=@android:requestPermissions:, request=1, result=-1, data=Intent { act=android.content.pm.action.REQUEST_PERMISSIONS (has extras) }} to activity {tts.mobility.phalsbourg/tts.mobility.phalsbourg.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void org.apache.cordova.CallbackContext.sendPluginResult(org.apache.cordova.PluginResult)' on a null object reference

peitschie commented 7 months ago

@sivakavi-manurevasolutions what version of this plugin are you using? This looks similar to something like #698

sivakavi-manurevasolutions commented 7 months ago

@peitschie plugin version : v1.3.0

peitschie commented 7 months ago

That's a really old version of the plugin. Could you try upgrading to latest and seeing whether issue goes away? There's been quite a few fixes around this area in various release. v1.7.1 is the current version, and should work without any changes in your latest app.

sivakavi-manurevasolutions commented 7 months ago

@peitschie Sure, Thanks

peitschie commented 6 months ago

I'll close this out, as the old version of the plugin (1.3.0) was unlikely to be fully compatible with the recent Android versions described here. Feel free to re-open if the current release still shows the same issue.