LedgerHQ/ledger-live

[Bug]: Android 14 usb support

Closed this issue · 4 comments

Impacted Library name

@ledgerhq/react-native-hid

Impacted Library version

all

Describe the bug

After upgrading Android project to sdk 34 (which is now required to publish to play store), the following error occurs:

One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts

Expected behavior

App should not crash when using the library.

Additional context

https://stackoverflow.com/a/77276774

Lines:

and

getReactApplicationContext().registerReceiver(receiver, intFilter);

Need to be updated to include RECEIVER_NOT_EXPORTED like

getReactApplicationContext().registerReceiver(receiver, intFilter, RECEIVER_NOT_EXPORTED); 

Or rather this for retrocompatibility

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
            getReactApplicationContext().registerReceiver(receiver, intFilter, Context.RECEIVER_NOT_EXPORTED);
        } else {
            getReactApplicationContext().registerReceiver(receiver, intFilter);
        }

I create this PR that fix the error: #7880

This issue is stale because it has been open 30 days with no activity. Remove stale label, comment, or consider closing it.

Still an issue, the PR is just stuck it seems.

This issue is stale because it has been open 30 days with no activity. Remove stale label, comment, or consider closing it.