2

我实际上正在尝试使用react-native-camera,但我在第 14 行一直遇到错误:https ://github.com/react-native-community/react-native-camera/blob/master/src/handlePermissions.js #L14哪里

const granted = await PermissionsAndroid.request(PermissionsAndroid.PERMISSIONS.CAMERA, {
        title: permissionDialogTitle,
        message: permissionDialogMessage,
      });

我得到的错误是:

Cannot read property 'request' of undefined
TypeError: Cannot read property 'request' of undefined

我怀疑这PermissionsAndroid是进口的方式:

import { PermissionsAndroid } from 'react-native';

但是PermissionsAndroidundefined。看着react-native.js,我找不到PermissionsAndroid任何地方。是不是被搬走了?我在react-native-cli: 2.0.1

任何想法表示赞赏。

4

0 回答 0