title: Expo Camera crashing on Android devices
body: <p>I'm trying to use Expo Camera to take pictures and scan barcodes, but for some reason whenever I run it on an Android device when I am about to use the camera the app crashes. This is the code used for taking pictures/scanning barcodes. I don't believe it is a code issue though:</p>
  <pre><code>import React, { useState, useEffect } from 'react';
  import { Text, View, TouchableOpacity, Image, Alert } from 'react-native';
  import { IconButton, Colors, Button } from 'react-native-paper'
  import { Camera } from 'expo-camera';
  
  const CustomBarcodeScanner = ({ handleBarCodeScanned, scanning, handleTakePhotos, handleGoBack }) =&gt; {
    const [hasPermission, setHasPermission] = useState(null)
    const [preview, setPreview] = useState(false)
    const [currentPhoto, setCurrentPhoto] = useState('')
    const [photoCount, setPhotoCount] = useState(0)
  
    const displaySnap = scanning ? &quot;none&quot; : &quot;flex&quot;
  
    const snap = async() =&gt; {
      if(this.camera){
        let photo = await this.camera.takePictureAsync({base64: true})
        setCurrentPhoto(photo['base64'])
        setPhotoCount(photoCount + 1)
        setPreview(true)
      }
    }
  
    const acceptPhoto = () =&gt; {
      setPreview(false)
      handleTakePhotos(currentPhoto)
      setCurrentPhoto('')
      console.log(photoCount)
      if(photoCount &gt;= 2){
        handleGoBack()
        return
      }
      Alert.alert(
        &quot;Tomar otra foto&quot;,
        &quot;¿Desea tomar otra foto?&quot;,
        [
          {
            text: 'Sí',
            onPress: () =&gt; {
            }
          },
          {
            text: 'No',
            onPress: () =&gt; {
              handleGoBack()
            },
            style: &quot;cancel&quot;
          }
        ],
        { cancelable: false }
      )
    }
  
    const retakePhoto = () =&gt; {
      setPreview(false)
      setCurrentPhoto('')
    }
  
    useEffect(() =&gt; {
      (async () =&gt; {
        const { status } = await Camera.requestPermissionsAsync();
        setHasPermission(status === 'granted');
      })()
    }, [])
  
    if (hasPermission === null) {
      return &lt;View /&gt;;
    }
    if (hasPermission === false) {
      return &lt;Text&gt;No access to camera&lt;/Text&gt;;
    }
    return preview ? 
      &lt;View style={{flex: 1, alignItems: 'center', justifyContent: 'center'}}&gt;
        &lt;Image style={{width: '100%', height: '70%'}} source={{ uri: `data:image/jpg;base64,${currentPhoto}` }} /&gt;
        &lt;View style={{flexDirection: 'row'}}&gt;
          &lt;Button 
            mode='contained'
            color={Colors.purple500} 
            style={{padding: 10, margin: 10}}
            onPress={acceptPhoto}
          &gt;
            Aceptar
          &lt;/Button&gt;
          &lt;Button
            mode='contained'
            color={Colors.purple500}
            style={{padding: 10, margin: 10}}
            onPress={retakePhoto}
          &gt;
            Re-Tomar Foto
          &lt;/Button&gt;
        &lt;/View&gt;
      &lt;/View&gt;
      :
      &lt;View style={{ flex: 1 }}&gt;
        &lt;Camera
        style={{ flex: 1 }} type={Camera.Constants.Type.back} onBarCodeScanned={handleBarCodeScanned} ref={ref =&gt; {this.camera = ref}}&gt;
          &lt;View
            style={{
              flex: 1,
              backgroundColor: 'transparent',
              flexDirection: 'row',
            }}
            &gt;
            &lt;TouchableOpacity
              style={{
                flex: 0.1,
                alignSelf: 'flex-end',
                alignItems: 'center',
              }}
              onPress={handleGoBack}
            &gt;
              &lt;Text style={{ fontSize: 18, marginBottom: 10, color: 'white' }}&gt;Regresar&lt;/Text&gt;
            &lt;/TouchableOpacity&gt;
            &lt;TouchableOpacity
              style={{
                flex: 0.8,
                alignSelf: 'flex-end',
                alignItems: 'center',
                display: displaySnap
              }}
              onPress={() =&gt; snap() }
            &gt;
              &lt;IconButton icon='camera' background={Colors.black} size={50} color={Colors.white} /&gt;
            &lt;/TouchableOpacity&gt;
          &lt;/View&gt;
        &lt;/Camera&gt;
      &lt;/View&gt;
  }
  
  export default CustomBarcodeScanner
  </code></pre>
  <p>I'm thinking it could be dependency related? I'm not sure if I need to install some libraries or add some code to get it to work. The error I get says <code>Error while updating property 'nativeBackgroundAndroid' of a view managed by: RCTView</code></p>
  <p>My expo version is 4.1.6</p>