BluetoothSerial icon indicating copy to clipboard operation
BluetoothSerial copied to clipboard

App crash after start, if I use this plugin

Open SteveeH opened this issue 3 years ago • 5 comments

Hello,

i want to use this plugin in my application, I just create new Cordova but after I install it "cordova plugin add cordova-plugin-bluetooth-serial" application always crash after launch, even if I didn't use any code from plugin (its just helloWorld app). I want to add some logs, but I can't open debug console because app crash immediately.

Do you have any idea, is it because of new version of iOS?

Cordova: 11.0.0 iOS : 16.1

Thanks you all for response

SteveeH avatar Nov 19 '22 18:11 SteveeH

A good start is to check what the XCode console says before the app crashes; there you should be able to find the error that caused it. There is definitely initialization logic that runs on the plugin regardless if you actually invoked any method.

Glavotaner avatar Mar 06 '23 14:03 Glavotaner

calling this bluetoothSerial.isConnected caused it to crash for me.

pitamash avatar Jun 22 '23 01:06 pitamash

calling this bluetoothSerial.isConnected caused it to crash for me.

@pitamash What platform are you on? Can you try to copy-paste the error you get from logcat or Xcode console?

Glavotaner avatar Jun 22 '23 13:06 Glavotaner

I added this in androidManifest.xml file;

<uses-permission android:name="android.permission.BLUETOOTH_SCAN" android:usesPermissionFlags="neverForLocation" />

On Thu, Jun 22, 2023 at 4:45 PM Glavotaner @.***> wrote:

calling this bluetoothSerial.isConnected caused it to crash for me.

@pitamash https://github.com/pitamash What platform are you on? Can you try to copy-paste the error you get from logcat or Xcode console?

— Reply to this email directly, view it on GitHub https://github.com/don/BluetoothSerial/issues/455#issuecomment-1602668473, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFOLPWSLQCTZ6K6JARXHT5TXMREBNANCNFSM6AAAAAASFNUM6I . You are receiving this because you were mentioned.Message ID: @.***>

pitamash avatar Jun 22 '23 15:06 pitamash

@pitamash You won't be able to use the new SCAN/CONNECT/DISCOVER permissions; you can put them in your manifest, but they are runtime permissions so the plugin still has to check/request those permissions at runtime. That won't happen because the project isn't maintained and while people have made PRs for that, the author isn't available to merge them.

I'd advise you to make your own fork, or use someone else's; eg. this one is mine https://github.com/Glavotaner/bluetooth-serial

Glavotaner avatar Jun 22 '23 15:06 Glavotaner