mobile_scanner icon indicating copy to clipboard operation
mobile_scanner copied to clipboard

Black screen on Flutter Web and iOS

Open mklepaczko opened this issue 2 years ago • 10 comments

What

  • When trying to use scanner on Flutter web and IOS I get a black screen and scanner is not working.
  • This issue is also mentioned in first comment of this tutorial: https://www.youtube.com/watch?v=Oaujc9-LagY

mklepaczko avatar Apr 13 '22 13:04 mklepaczko

I confirm this

Masishta avatar Apr 14 '22 07:04 Masishta

Are you using the current release from pub or the main branch from Github? @mklepaczko @Masishta

EricRode avatar Apr 14 '22 07:04 EricRode

Are you using the current release from pub or the main branch from Github? @mklepaczko @Masishta

Current release from pub (version 1.0.0)

Masishta avatar Apr 14 '22 08:04 Masishta

Okay, then please try the main branch from Github because one of the recent PRs fixed this problem. You can use the main branch by including mobile_scanner: git: url: https://github.com/juliansteenbakker/mobile_scanner

EricRode avatar Apr 14 '22 09:04 EricRode

Same issue with git branch

Masishta avatar Apr 14 '22 10:04 Masishta

Yes current from pub

Mkl W dniu czw., 14.04.2022 o 09:45 EricRode @.***> napisał(a):

Are you using the current release from pub or the main branch from Github? @mklepaczko https://github.com/mklepaczko @Masishta https://github.com/Masishta

— Reply to this email directly, view it on GitHub https://github.com/juliansteenbakker/mobile_scanner/issues/101#issuecomment-1098808006, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMPEZGAW5GZ2IHSJQJQAQ3LVE7EJ5ANCNFSM5TKUDMPQ . You are receiving this because you were mentioned.Message ID: @.***>

mklepaczko avatar Apr 14 '22 13:04 mklepaczko

Unfortunately I don't have an IOS device. Could you try to start the scanner on IOS and take a look at the console of the browser ? Maybe the error is displayed there.

EricRode avatar Apr 14 '22 14:04 EricRode

Hello @EricRode ,

First of all thanks for your quick reply and your work on that pluggin!

I just used the pluggin from your main brach, the situation has somehow changed:

  • now on IOS it is requesting the camera usage acceptance, the red camera icon shows on Safari address bar (did not work before)
  • Then shows white scaffold page, and the image from the camera appears sometimes after clicking the screen.
  • The image appears after calling pop() on the screen for a small time before popping the screen and when changing screen orientation, when the screen is rebuilt.
  • I tried on an Android device, Huawei P30 pro, it does not request camera usage and the screen remains black.

The only errors I could catch from the Safari debugger are the following:

Loading app from service worker. main.dart.js:21614 MobileScannerWeb: NotFoundError: Requested device not found A MediaStreamTrack ended due to a capture failure

Mkl

mklepaczko avatar Apr 15 '22 12:04 mklepaczko

Hello,

update from today: my iphone 12 updated to IOS 15.4.1 and camera seems to work fine now.

On Android still not working, black screen and no camera request authorization. (Huawei P30 pro)

mklepaczko avatar Apr 19 '22 08:04 mklepaczko

This error could be related to another one I found in Android when you try to reopen the MobileScanner widget. It happens trying to read one QR after having read another one. I posted a question in StackOverflow trying to find a solution because I couldn't after many tries. I created a project in my Github where you can reproduce this error using the Android emulator.

amendezcabrera avatar Apr 21 '22 14:04 amendezcabrera

can confirm, does not work in web / iOS and PWA

MB175 avatar Nov 30 '22 23:11 MB175

Okay, then please try the main branch from Github because one of the recent PRs fixed this problem. You can use the main branch by including mobile_scanner: git: url: https://github.com/juliansteenbakker/mobile_scanner

@EricRode Issue is also present in "^3.0.0-beta.2"

MB175 avatar Dec 01 '22 22:12 MB175

2.1.0 is working if the service worker is delivered by https "as browser standards require" PWAs are working on iOS and chrome. So if somebody tries to host his PWA on a static Webserver and test it locally make sure the server has a cert otherwise also the mobile browsers won't register the service_workers and the camera won't work

MB175 avatar Dec 02 '22 02:12 MB175

Version 3.0.0-beta.4 updated the web framework. Can you please try again with that version, and comment if the issue still exists.

juliansteenbakker avatar Dec 14 '22 19:12 juliansteenbakker

Hi @juliansteenbakker I still got the black screen on the web (chrome) and iOS using 3.0.0-beta.4. image

elsenkarmaclub avatar Jan 26 '23 09:01 elsenkarmaclub

Hi @juliansteenbakker I still got the black screen on the web (chrome) and iOS using 3.0.0-beta.4. image

Chrome on iOS ? if so do u use a https connection otherwise the ServiceWorkers won't work. Chrome on iOS is just WebKit

MB175 avatar Jan 26 '23 15:01 MB175

Hi @juliansteenbakker I still got the black screen on the web (chrome) and iOS using 3.0.0-beta.4. image

Chrome on iOS ? if so do u use a https connection otherwise the ServiceWorkers won't work. Chrome on iOS is just WebKit

No, I mean web app (chrome) and also in iOS app.

elsenkarmaclub avatar Jan 26 '23 18:01 elsenkarmaclub