On Android 11, due to a package query limitation, the app cannot scan for other apps(e.g. browsers) that can open the URL, when the browsers are indeed on the device.
This is due to <queries> declaration in AndroidManifest.xml not implemented properly, hence the app is not given permissions to scan for packages; intent.resolveActivity always returns null.
Steps to reproduce:
Open the app
Point the camera at a QR code/barcode which contains a web URL.
Click the associated action, "Open link"
Expected behaviour:
App redirects to browser, or displays a chooser dialog if multiple browsers are available, or displays a toast "No browsers found" when no browsers to open the QR code are found.
Actual behaviour:
"No browsers found" displayed even when browsers are found. (see video attached)
Affected devices:
All devices running Android 11 (API 30) and above.
Possible solutions
Remove the queries tag and add a try-catch block, catching ActivityNotFoundException, when no browsers are found.
Properly implement the queries tag, so that app has the proper permissions to scan for browsers (or apps with intent filter Intent.ACTION_VIEW)
On Android 11, due to a package query limitation, the app cannot scan for other apps(e.g. browsers) that can open the URL, when the browsers are indeed on the device. This is due to
<queries>
declaration inAndroidManifest.xml
not implemented properly, hence the app is not given permissions to scan for packages;intent.resolveActivity
always returnsnull
.Steps to reproduce:
Expected behaviour: App redirects to browser, or displays a chooser dialog if multiple browsers are available, or displays a toast "No browsers found" when no browsers to open the QR code are found.
Actual behaviour: "No browsers found" displayed even when browsers are found. (see video attached)
Affected devices: All devices running Android 11 (API 30) and above.
Possible solutions
ActivityNotFoundException
, when no browsers are found.queries
tag, so that app has the proper permissions to scan for browsers (or apps with intent filterIntent.ACTION_VIEW
)https://user-images.githubusercontent.com/58442255/119657575-ac309380-be5e-11eb-84ac-9dbcccffc9ad.mp4