AbobosSoftware / cordova-plugin-brother-label-printer

Cordova and Capacitor plugin for Bother Label Printers
MIT License
10 stars 16 forks source link

Error while printing on Android 12 and above via BlueTooth #60

Closed arcadius closed 5 months ago

arcadius commented 5 months ago

The below error appears when printing on Android 12 or above

Failed to print:
java.lang.SecurityException: Need android.permission.BLUETOOTH_CONNECT permission for android.content.AttributionSource@879bf1d0: AdapterService getBondedDevices
    at android.os.Parcel.createExceptionOrNull(Parcel.java:2426)
    at android.os.Parcel.createException(Parcel.java:2410)
    at android.os.Parcel.readException(Parcel.java:2393)
    at android.os.Parcel.readException(Parcel.java:2335)
    at android.bluetooth.IBluetooth$Stub$Proxy.getBondedDevices(IBluetooth.java:3379)
    at android.bluetooth.BluetoothAdapter.getBondedDevices(BluetoothAdapter.java:2502)
    at com.brother.ptouch.sdk.connection.BluetoothConnection.getPrinterDevice(BluetoothConnection.java:238)
    at com.brother.ptouch.sdk.connection.BluetoothConnection.open(BluetoothConnection.java:56)
    at com.brother.ptouch.sdk.Printer.init(Printer.java:2215)
    at com.brother.ptouch.sdk.Printer.startCommunication(Printer.java:2350)
    at com.brother.ptouch.sdk.printdemo.printprocess.BasePrint$PrinterThread.run(BasePrint.java:713)
arcadius commented 5 months ago

fixed in PR https://github.com/AbobosSoftware/cordova-plugin-brother-label-printer/pull/59