chuvanhoang888 / smart_usb

Smart Usb
BSD 3-Clause "New" or "Revised" License
4 stars 10 forks source link

doesnt work on android 14 #7

Open crushman1 opened 8 months ago

crushman1 commented 8 months ago

My app was working fine. then comes android 14. Now no usb printing plugin works. not even this one. its able to scan for devices, it can SEE the devices but i cannot connect to the device. infact is closes the app. This is the error :

E/AndroidRuntime( 6368): java.lang.NullPointerException: Attempt to invoke virtual method 'void android.app.PendingIntent.send(android.content.Context, int, android.content.Intent)' on a null object reference
E/AndroidRuntime( 6368):    at android.os.Parcel.createExceptionOrNull(Parcel.java:3075)
E/AndroidRuntime( 6368):    at android.os.Parcel.createException(Parcel.java:3053)
E/AndroidRuntime( 6368):    at android.os.Parcel.readException(Parcel.java:3036)
E/AndroidRuntime( 6368):    at android.os.Parcel.readException(Parcel.java:2978)
E/AndroidRuntime( 6368):    at android.hardware.usb.IUsbManager$Stub$Proxy.requestDevicePermission(IUsbManager.java:1491)
E/AndroidRuntime( 6368):    at android.hardware.usb.UsbManager.requestPermission(UsbManager.java:1453)
E/AndroidRuntime( 6368):    at com.example.smart_usb.SmartUsbPlugin.RequireDevice(SmartUsbPlugin.kt:366)
E/AndroidRuntime( 6368):    at com.example.smart_usb.SmartUsbPlugin$onMethodCall$1.invokeSuspend(SmartUsbPlugin.kt:160)
E/AndroidRuntime( 6368):    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
E/AndroidRuntime( 6368):    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
E/AndroidRuntime( 6368):    at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:115)
E/AndroidRuntime( 6368):    at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:103)
E/AndroidRuntime( 6368):    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
E/AndroidRuntime( 6368):    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
E/AndroidRuntime( 6368):    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
E/AndroidRuntime( 6368):    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
E/AndroidRuntime( 6368):    Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@a86e071, Dispatchers.IO]
E/AndroidRuntime( 6368): Caused by: android.os.RemoteException: Remote stack trace:
E/AndroidRuntime( 6368):    at com.android.server.usb.UsbUserPermissionManager.requestPermission(UsbUserPermissionManager.java:803)
E/AndroidRuntime( 6368):    at com.android.server.usb.UsbService.requestDevicePermission(UsbService.java:648)
E/AndroidRuntime( 6368):    at android.hardware.usb.IUsbManager$Stub.onTransact(IUsbManager.java:775)
E/AndroidRuntime( 6368):    at android.os.Binder.execTransactInternal(Binder.java:1375)
E/AndroidRuntime( 6368):    at android.os.Binder.execTransact(Binder.java:1311)
E/AndroidRuntime( 6368): 
D/SessionLifecycleClient( 6368): Sending lifecycle 2 to service
D/SessionLifecycleService( 6368): Activity backgrounding at 5531998
I/Process ( 6368): Sending signal. PID: 6368 SIG: 9

I have tried added all manner of permissions to the manifest but nothing works.