8
votes

The react native expo camera example gives errors like _Camera is not defined https://docs.expo.io/versions/latest/sdk/camera.html but I see others have gotten it to work here

Does anyone have some basic code on how to make use of the camera module? Or debug why the documentation example isn't working?

1
Same here, you got any camera code work's in expo?Anjal Saneen

1 Answers

4
votes

I got same issue, after a lot of research Expo Camera is added from v20.I was using v19.0. I am new to Expo and did not realize it was added in v20 here. Problem is solved after upgrading react-native expo version to v20. .basic code for camera in expo is here

edit in package.json

"react-native": "https://github.com/expo/react-native/archive/sdk-20.0.0.tar.gz",

"expo": "20.0.0-alpha.4",

"react": "16.0.0-alpha.12",

edit in app.json

"sdkVersion": "20.0.0",
  • Delete your project’s node_modules directory and run npm install

  • Reopen your project in XDE and press “Restart” to clear the packager cache