mebjas / html5-qrcode

A cross platform HTML5 QR code reader. See end to end implementation at: https://scanapp.org
https://qrcode.minhazav.dev
Apache License 2.0
4.9k stars 960 forks source link

QR Start Scanner not working after Webview 118 update #856

Open Adrxking opened 10 months ago

Adrxking commented 10 months ago

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

sailendrakdhal commented 10 months ago

We are also facing the same issue.

Adrxking commented 10 months ago

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

ROBERT-MCDOWELL commented 10 months ago

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

Adrxking commented 10 months ago

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

ROBERT-MCDOWELL commented 10 months ago

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

Adrxking commented 10 months ago

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

ROBERT-MCDOWELL commented 10 months ago

you re welcome

Adrxking commented 10 months ago

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.

ROBERT-MCDOWELL commented 10 months ago

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 commented 10 months ago

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

Adrxking commented 10 months ago

@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.

ROBERT-MCDOWELL commented 10 months ago

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

Adrxking commented 10 months ago

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

ROBERT-MCDOWELL commented 10 months ago

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

Adrxking commented 10 months ago

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.