RNCamera Error:TypeError: CameraManager.checkIfRecordAudioPermissionsAreDefined is not a function

[Unhandled promise rejection: TypeError: CameraManager.checkIfRecordAudioPermissionsAreDefined is not a function. (In 'CameraManager.checkIfRecordAudioPermissionsAreDefined()', 'CameraManager.checkIfRecordAudioPermissionsAreDefined' is undefined)]

return (
  <View>
    <Text>Welcome to React Native QRScanner!</Text>

    <RNCamera
      ref={ref => {
        this.camera = ref;
      }}
      style={{
        flex: 1,
        width: '100%'
      }}
      androidRecordAudioPermissionOptions={{
        title: 'Permission to use audio recording',
        message: 'We need your permission to use your audio',
        buttonPositive: 'Ok',
        buttonNegative: 'Cancel',
      }}
      onBarCodeRead={this.barcodeRecognized}
    >

    </RNCamera>
  </View>
);

Add using captureAudio={false} to bypass this error.


  1. Stop Developement server if running.

  2. Remove react-native-camera with:

    yarn remove react-native-camera
    

    or:

    npm uninstall react-native-camera`
    
  3. Add react-native-camera again with:

    yarn add react-native-camera
    

    or:

    npm i react-native-camera`
    
  4. Run agian with react-native run-android

If you get an error like:

Could not resolve project :react-native-camera

then you have to add line missingDimensionStrategy 'react-native-camera', 'general' in your android/app/build.gradle file under defaultConfig.


Reinstalling by following the official documentation resolved the problem for me (manual installation).