我已将react-native-camera 添加到我的应用程序中。创建使用 RNCamera 的组件后,每次我尝试运行我的应用程序(使用react-native run-android)时,它都会请求必要的权限(相机和音频),然后立即崩溃,而不输出任何错误消息。
这是我的 package.json:
{
"main": "index.js",
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"web": "expo start --web",
"start": "react-native start",
"test": "jest"
},
"dependencies": {
"@react-native-community/async-storage": "^1.12.1",
"@tensorflow-models/mobilenet": "^2.0.4",
"@tensorflow/tfjs": "^3.3.0",
"@tensorflow/tfjs-react-native": "^0.5.0",
"expo": "~40.0.0",
"expo-camera": "~9.1.0",
"expo-constants": "^10.0.1",
"expo-gl": "~9.2.0",
"expo-gl-cpp": "~9.2.0",
"expo-splash-screen": "~0.8.0",
"expo-status-bar": "~1.0.3",
"expo-updates": "~0.4.0",
"mobx": "^6.1.8",
"react": "16.13.1",
"react-dom": "16.13.1",
"react-native": "~0.63.4",
"react-native-camera": "^3.43.0",
"react-native-fs": "^2.16.6",
"react-native-gesture-handler": "~1.8.0",
"react-native-reanimated": "~1.13.0",
"react-native-screens": "~2.15.0",
"react-native-unimodules": "~0.12.0",
"react-native-web": "~0.13.12"
},
"devDependencies": …Run Code Online (Sandbox Code Playgroud)