Skip to content

Requesting Permission has been failed on Android 14 #56

Closed
@cleandev007

Description

@cleandev007

On Android 14, There are 2 problems

  1. Receiver_Export issue

image

this error occurs on the following code line, UsbSerialForAndroid/Extensions/UsbManagerExtensions.cs
context.RegisterReceiver(usbPermissionReceiver, new IntentFilter(ACTION_USB_PERMISSION));

I changed it to following

if (Build.VERSION.SdkInt >= BuildVersionCodes.Tiramisu)
context.RegisterReceiver(usbPermissionReceiver, new IntentFilter(ACTION_USB_PERMISSION), (ActivityFlags)ReceiverFlags.Exported);
else
context.RegisterReceiver(usbPermissionReceiver, new IntentFilter(ACTION_USB_PERMISSION));

  1. PendingIntent parma issue

image

this error occurs on the following code line
PendingIntentFlags pendingIntentFlags = Build.VERSION.SdkInt >= BuildVersionCodes.S ? PendingIntentFlags.Mutable : 0;

I changed it Immutable. But I can't get the permission.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions