html5-qrcode icon indicating copy to clipboard operation
html5-qrcode copied to clipboard

QR Start Scanner not working after Webview 118 update

Open Adrxking opened this issue 2 years ago • 15 comments

This plugin does not work on devices with WebView 118 update. When I start the Scanner i get an error "cameraIdOrConfigRequired"

The code of my project has not changed on the last 5 months, If I remove Webview updates from my device it starts to work again.

To Reproduce Steps to reproduce the behavior: Update Android System Webview to 118 version

Expected behavior It should start the scanner

Smartphone (please complete the following information): Any device with Android System Webview version 118

Adrxking avatar Oct 27 '23 10:10 Adrxking

We are also facing the same issue.

sailendrakdhal avatar Oct 27 '23 10:10 sailendrakdhal

this is going to affect all Android Devices, its a breaking change :( Does anyone know if its going to be solved in this repository ?

Adrxking avatar Oct 28 '23 14:10 Adrxking

better you ask the browser developers or find the major changes in their changelog that can break JS scripts

ROBERT-MCDOWELL avatar Oct 28 '23 15:10 ROBERT-MCDOWELL

its impossible to find the major changes, they dont have a clear changelog so cannot check the break JS scripts @ROBERT-MCDOWELL

Adrxking avatar Oct 30 '23 07:10 Adrxking

ok so the best way is to verbose the console.log to debug and see what's happening

ROBERT-MCDOWELL avatar Oct 30 '23 08:10 ROBERT-MCDOWELL

Im gonna try it, hopefully i will be able to help the community. Thank you @ROBERT-MCDOWELL

Adrxking avatar Oct 30 '23 08:10 Adrxking

you re welcome

ROBERT-MCDOWELL avatar Oct 30 '23 08:10 ROBERT-MCDOWELL

I got some news debugging, navigator.mediaDevices.enumerateDevices() returns empty labels, ids and groups, the return with the new WebView 118 is: [ { "deviceId": "", "kind": "audioinput", "label": "", "groupId": "" }, { "deviceId": "", "kind": "videoinput", "label": "", "groupId": "" }, { "deviceId": "", "kind": "audiooutput", "label": "", "groupId": "" } ]

Do you know whats could be happening here @ROBERT-MCDOWELL ? Im going to debug more.

Adrxking avatar Oct 30 '23 12:10 Adrxking

this is a common issue due to OS permission with the browser.. try to search on browser developers issue community about devicce permissions

ROBERT-MCDOWELL avatar Oct 30 '23 12:10 ROBERT-MCDOWELL

FYI https://developer.android.com/training/permissions/requesting did you try with other browsers?

ROBERT-MCDOWELL avatar Oct 30 '23 12:10 ROBERT-MCDOWELL

@ROBERT-MCDOWELL I get the CAMERA permission on my APP init. It was working OK for 1 year without any updates but now it just stopped to work after updating devices to Android Webview 118 version, it occurs on every Android device with that webview.

I tried to remove updates from Android Webview on my device and it started to work again...

My App has CAMERA permissions granted but it just fails getting the device IDs executing the navigator.mediaDevices.enumerateDevices().

I tried it with 4 different devices with different Android versions and it occurs on every Android Version, if the device has webview v118 it just doesnt works.

On the WEB it works fine, the problem is that i have my APP compiled with CORDOVA and it doesnt works on android devices, i cant change the browser because it depends on the WebView, not the browser.

Adrxking avatar Oct 30 '23 12:10 Adrxking

ok so your issue is related to webview 118 for app, so consult their developers then.

ROBERT-MCDOWELL avatar Oct 30 '23 12:10 ROBERT-MCDOWELL

Do you know where i can contact them ? I have been searching but i dont find any place

Adrxking avatar Oct 30 '23 12:10 Adrxking

android developers https://developer.android.com/

ROBERT-MCDOWELL avatar Oct 30 '23 13:10 ROBERT-MCDOWELL

Found this issue, which is exactly this error: https://bugs.chromium.org/p/chromium/issues/detail?id=1496784&q=enumerateDevices&can=2

Hopefully Chrome Devs will solve it.

Adrxking avatar Oct 30 '23 14:10 Adrxking