You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[camera_web] CameraException: cameraNotReadable, The camera is not readable due to a hardware error that prevented access to the device. #97016
changed the title [-][camera] [camera_web] cameraNotReadable error on flutter web[/-][+][camera_web] CameraException: cameraNotReadable, The camera is not readable due to a hardware error that prevented access to the device.[/+]on Jan 24, 2022
Hi @saurabh-m-w, Thanks for filing the issue. I ran the official example and it seems to work fine. Please make sure the permission is granted and the camera is not being used elsewhere (other apps) on the device.
Yes I am allowing permissions ,sample app also working fine, I think issue is with my code but its working fine on local server but getting error on deployed website.
Here is my code
I think I should cameras = await availableCameras(); add this in previous screen as given in official sample code.
flutter doctor -v
• Flutter version 2.5.0-6.0.pre at C:\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 225a43d941 (6 months ago), 2021-08-05 11:32:48 -0700
• Engine revision 07ec4b82c7
• Dart version 2.14.0 (build 2.14.0-383.0.dev)
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at C:\Users\shree\AppData\Local\Android\sdk
X cmdline-tools component is missing
Run `path/to/sdkmanager --install "cmdline-tools;latest"`
See https://developer.android.com/studio/command-line for more details.
X Android license status unknown.
Run `flutter doctor --android-licenses` to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.
[√] Chrome - develop for the web
• Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
[√] Android Studio (version 2020.3)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
[√] VS Code, 64-bit edition (version 1.47.3)
• VS Code at C:\Program Files\Microsoft VS Code
• Flutter extension can be installed from:
https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[√] Connected device (1 available)
• Chrome (web) • chrome • web-javascript • Google Chrome 97.0.4692.99
! Doctor found issues in 1 category.```
Thanks for the update @saurabh-m-w, You seem to be on the older version of flutter. Please try upgrading to the latest stable 2.8.1 and see if it resolves the issue. If the issue persists please share the complete error logs in a text file. Also if you can create a reproducible code sample from your code that would help to debug the issue.
I ran into this same error while messing around and testing random stuff. I get it when I run my code with the Debug Chrome Web browser which is launched from Android Studio. Also the sample app (https://cameraweb.netlify.app/#/) will not work when opened with that debug browser. It will ask for permission and once I give it, the camera flashes its activity light and goes dark. Debug log gives the following trace:
Error: CameraException(cameraNotReadable, The camera is not readable due to a hardware error that prevented access to the device.)
at Object.throw_ [as throw] (http://localhost:36821/dart_sdk.js:5386:11)
at camera_web.CameraPlugin.new.availableCameras (http://localhost:36821/packages/camera_web/src/camera_web.dart.lib.js:222:23)
at availableCameras.throw (<anonymous>)
at http://localhost:36821/dart_sdk.js:42616:38
at _RootZone.runBinary (http://localhost:36821/dart_sdk.js:42471:58)
at _FutureListener.thenAwait.handleError (http://localhost:36821/dart_sdk.js:37046:33)
at handleError (http://localhost:36821/dart_sdk.js:37652:51)
at Function._propagateToListeners (http://localhost:36821/dart_sdk.js:37678:17)
at _Future.new.[_completeError] (http://localhost:36821/dart_sdk.js:37524:23)
at async._AsyncCallbackEntry.new.callback (http://localhost:36821/dart_sdk.js:37563:31)
at Object._microtaskLoop (http://localhost:36821/dart_sdk.js:42771:13)
at _startMicrotaskLoop (http://localhost:36821/dart_sdk.js:42777:13)
at http://localhost:36821/dart_sdk.js:37905:9
When I try my code in any other browser than the debug chrome it works just fine and so does the sample app. I don't know what is different about the Chrome Debug browser launched from Android studio, but maybe this additional info will help someone else who is having this problem.
I am doing like this On Page 1 List<CameraDescription> camerasList = await availableCameras();
and passing camerasList to next page2 where I am using camera.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
[-][camera] [camera_web] cameraNotReadable error on flutter web[/-][+][camera_web] CameraException: cameraNotReadable, The camera is not readable due to a hardware error that prevented access to the device.[/+]maheshj01 commentedon Jan 24, 2022
Hi @saurabh-m-w, Thanks for filing the issue. I ran the official example and it seems to work fine. Please make sure the permission is granted and the camera is not being used elsewhere (other apps) on the device.
Can you please check this deployed sample app https://cameraweb.netlify.app/#/
based on the official sample codeand see if this works fine?Also, please share the output of
flutter doctor -v.code sample for the web app
flutter doctor -v
saurabh-m-w commentedon Jan 24, 2022
Yes I am allowing permissions ,sample app also working fine, I think issue is with my code but its working fine on local server but getting error on deployed website.
Here is my code
I think I should
cameras = await availableCameras();add this in previous screen as given in official sample code.flutter doctor -vmaheshj01 commentedon Jan 24, 2022
Thanks for the update @saurabh-m-w, You seem to be on the older version of flutter. Please try upgrading to the latest
stable 2.8.1and see if it resolves the issue. If the issue persists please share the complete error logs in a text file. Also if you can create a reproducible code sample from your code that would help to debug the issue.maheshj01 commentedon Jan 25, 2022
@saurabh-m-w was this resolved?
momentum27 commentedon Jan 25, 2022
Hello please i want know how to set up de size of the web view display ? Or send user-agent to the server of my website ?
maheshj01 commentedon Jan 26, 2022
@hanane9627, How-to questions are best answered on StackOverflow. However webview has a user agent parameter, you could set it like this
BessBrahmin commentedon Feb 3, 2022
I ran into this same error while messing around and testing random stuff. I get it when I run my code with the Debug Chrome Web browser which is launched from Android Studio. Also the sample app (https://cameraweb.netlify.app/#/) will not work when opened with that debug browser. It will ask for permission and once I give it, the camera flashes its activity light and goes dark. Debug log gives the following trace:
When I try my code in any other browser than the debug chrome it works just fine and so does the sample app. I don't know what is different about the Chrome Debug browser launched from Android studio, but maybe this additional info will help someone else who is having this problem.
Garciconx commentedon Feb 10, 2022
I'm facing the same issue, Greetings!
saurabh-m-w commentedon Feb 11, 2022
For me its working fine now,I think this issue is fixed with latest camera_web: ^0.2.1+2 plugin.
Garciconx commentedon Feb 11, 2022
I'm still facing the same issue, do you use this? ->
Did you follow any extra steps to get this working?
saurabh-m-w commentedon Feb 11, 2022
I am doing like this On Page 1
List<CameraDescription> camerasList = await availableCameras();and passing camerasList to next page2 where I am using camera.
github-actions commentedon Feb 28, 2022
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.