简体   繁体   English

React Native Expo 相机

[英]React Native Expo Camera

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 react native expo 相机示例给出了诸如 _Camera is not defined https://docs.expo.io/versions/latest/sdk/camera.html 之类的错误,但我看到其他人已经让它在这里工作

Does anyone have some basic code on how to make use of the camera module?有没有人有一些关于如何使用相机模块的基本代码? Or debug why the documentation example isn't working?或者调试为什么文档示例不起作用?

I got same issue, after a lot of research Expo Camera is added from v20.I was using v19.0.我遇到了同样的问题,经过大量研究后,从 v20 添加了 Expo Camera。我使用的是 v19.0。 I am new to Expo and did not realize it was added in v20 here .我是新来的世博会,并没有意识到这是在V20加入这里 Problem is solved after upgrading react-native expo version to v20.将 react-native expo 版本升级到 v20 后问题解决。 . . basic code for camera in expo is here世博会相机的基本代码在这里

edit in package.json在 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在 app.json 中编辑

"sdkVersion": "20.0.0",
  • Delete your project's node_modules directory and run npm install删除项目的 node_modules 目录并运行npm install

  • Reopen your project in XDE and press “Restart” to clear the packager cache在 XDE 中重新打开您的项目并按“重新启动”以清除打包程序缓存

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM