growerp / nativescript-escpos-printer

A generic ESCPOS printer plugin for Nativescript, not maintained anymore....
Apache License 2.0
9 stars 2 forks source link

Android 12+ #8

Open maamarcos opened 1 year ago

maamarcos commented 1 year ago

Please, could you help making changes for Android 12+ ? Thanks!

Which platform(s) does your issue occur on?

System.err: An uncaught Exception occurred on "main" thread. System.err: Calling js method onClick failed System.err: Error: java.lang.SecurityException: Need android.permission.BLUETOOTH_CONNECT permission for android.content.AttributionSource@5dcb9d3f: AdapterService getBondedDevices System.err: System.err: StackTrace: System.err: module.exports.push../shared/Printer.index.android.js.PrintClient.getBlueToothPrinters(file: app/shared/Printer.index.android.js:79:0) System.err: at module.exports.push../shared/Printer.index.android.js.Printer.getBlueToothPrinters(file: app/shared/Printer.index.android.js:154:0) System.err: at SaidaPagamento.viewModel.getBlueToothPrinters(file: app/shared/view-models/saidaPagamento-view-model.js:516:0) System.err: at module.exports.push../views/saidaPagamento/saidaPagamento.js.exports.onTapGetPrinters(file: app/views/saidaPagamento/saidaPagamento.js:113:0) System.err: at _handleEvent(file: node_modules/@nativescript/core/data/observable/index.js:233:0) System.err: at notify(file: node_modules/@nativescript/core/data/observable/index.js:216:0) System.err: at _emit(file: node_modules/@nativescript/core/data/observable/index.js:256:0) System.err: at ClickListenerImpl.onClick(file: node_modules/@nativescript/core/ui/button/index.android.js:28:0) System.err: at com.tns.Runtime.callJSMethodNative(Native Method) System.err: at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1302) System.err: at com.tns.Runtime.callJSMethodImpl(Runtime.java:1188) System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1175) System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1153) System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1149) System.err: at com.tns.gen.java.lang.Object_vendor_18201_28_ClickListenerImpl.onClick(Object_vendor_18201_28_ClickListenerImpl.java:18) System.err: at android.view.View.performClick(View.java:7526) System.err: at android.view.View.performClickInternal(View.java:7503) System.err: at android.view.View.-$$Nest$mperformClickInternal(Unknown Source:0) System.err: at android.view.View$PerformClick.run(View.java:29359) System.err: at android.os.Handler.handleCallback(Handler.java:942) System.err: at android.os.Handler.dispatchMessage(Handler.java:99) System.err: at android.os.Looper.loopOnce(Looper.java:241) System.err: at android.os.Looper.loop(Looper.java:358) System.err: at android.app.ActivityThread.main(ActivityThread.java:8114) System.err: at java.lang.reflect.Method.invoke(Native Method) System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:942) System.err: Caused by: java.lang.SecurityException: Need android.permission.BLUETOOTH_CONNECT permission for android.content.AttributionSource@5dcb9d3f: AdapterService getBondedDevices System.err: at com.android.bluetooth.Utils.checkPermissionForDataDelivery(Utils.java:457) System.err: at com.android.bluetooth.Utils.checkConnectPermissionForDataDelivery(Utils.java:489) System.err: at com.android.bluetooth.btservice.AdapterService$AdapterServiceBinder.getBondedDevices(AdapterService.java:2622) System.err: at com.android.bluetooth.btservice.AdapterService$AdapterServiceBinder.getBondedDevices(AdapterService.java:2614) System.err: at android.bluetooth.IBluetooth$Stub.onTransact(IBluetooth.java:1109) System.err: at android.os.Binder.execTransactInternal(Binder.java:1285) System.err: at android.os.Binder.execTransact(Binder.java:1244) System.err: java.lang.reflect.InvocationTargetException System.err: at java.lang.reflect.Method.invoke(Native Method) System.err: at com.tns.NativeScriptUncaughtExceptionHandler.uncaughtException(NativeScriptUncaughtExceptionHandler.java:58) System.err: at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1073) System.err: at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1068) System.err: at java.lang.Thread.dispatchUncaughtException(Thread.java:2306) System.err: Caused by: java.lang.IllegalArgumentException: br.com.pikpark: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent. System.err: Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles. System.err: at android.app.PendingIntent.checkFlags(PendingIntent.java:409) System.err: at android.app.PendingIntent.getActivityAsUser(PendingIntent.java:492) System.err: at android.app.PendingIntent.getActivity(PendingIntent.java:478) System.err: at android.app.PendingIntent.getActivity(PendingIntent.java:442) System.err: at com.tns.ErrorReport.startPendingErrorActivity(ErrorReport.java:157) System.err: at com.tns.ErrorReport.startActivity(ErrorReport.java:136) System.err: ... 5 more