question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Expo Camera BUG in E_CAMERA_UNAVAILABLE

See original GitHub issue

After granted camera permissions using this function:

 async componentWillMount() {
      const { status } = await Permissions.askAsync(Permissions.CAMERA);
      this.setState({ hasCameraPermission: status === 'granted' });
      console.log(status);
    }

/Result: granted/

_takeAndUploadPhotoAsync = async () => {
      if (this.camera) {
        try {
          const res = await this.camera.takePictureAsync();
          console.log(res.uri);

         // this.setState({ photo: res.uri });
        } catch (error) {
          console.log('====================================');
          console.log('error in _takeAndUploadPhotoAsync', JSON.stringify(error));
          console.log('====================================');
        }
      }
    };

I’m getting this error :

error in _takeAndUploadPhotoAsync {"framesToPop":1,"code":"E_CAMERA_UNAVAILABLE","line":9631,"column":31,"sourceURL":"/data/user/0/host.exp.exponent/files/26.0.0/cached-bundle-experience-%40olympus%2Fchats651574282-26.0.0"} @Empact terribleben @expbot @esamelson @nikki93 @skevy Empact terribleben

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
aalicescommented, May 9, 2018

Is your preview up and ready when you attempt to take picture? If you’re trying to do it immediately after Camera is mounted it could throw an error because it hasn’t initialized yet.

0reactions
aalicescommented, Jun 27, 2018

Closing due to lack of activity. Feel free to reopen if this persists and provide some more info 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

[expo-camera] Bug. Reinitialising camera on video start ...
When start recording on iOS device, camera is reinitialising during 1-2 secs and records black video. Expected result: after calling recordAsync() camera is...
Read more >
Camera - Expo Documentation
The camera's parameters like zoom, auto focus, white balance and flash mode are adjustable. With the use of Camera , one can also...
Read more >
expo-camera error “camera not working” on android web app ...
I am using expo-camera on my app that can be run to a web on android/ios. Setting camera type works but when I...
Read more >
expo-camera - npm
A React component that renders a preview for the device's either front or back camera. Camera's parameters like zoom, auto focus, ...
Read more >
Manage Camera stretching problem in android device. - Expo
you can refer to the usage of camera (for qr code scanner) in expo client for an example of how to size it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found