title: react-native-image-crop-picker getting error "null is not an object" when i click on button
body: <p>Hi everyone i am learning REACT-NATIVE file upload with react-native-image-crop-picker while using it i am getting error like "null is not an object" when i click on button </p>
  
  <p>my Code:</p>
  
  <pre><code>pickSingleWithCamera(cropping, mediaType = 'photo') {
      ImagePicker.openCamera({
        cropping: cropping,
        width: 500,
        height: 500,
        includeExif: true,
        mediaType,
      }).then(image =&gt; {
        console.log('received image', image);
        this.setState({
          image: { uri: image.path, width: image.width, height: image.height, mime: image.mime },
          images: null
        });
      }).catch(e =&gt; alert(e));
    }
  
  
  &lt;TouchableOpacity onPress={() =&gt; this.pickSingleWithCamera(false)} style={styles.button}&gt;
                  &lt;Text style={styles.text}&gt;Select Single Image With Camera&lt;/Text&gt;
                &lt;/TouchableOpacity&gt;
  
  </code></pre>
  
  <p>i am also tried with bind(this) , then i am not getting error but no response from the camera </p>
  
  <pre><code>&lt;TouchableOpacity onPress={() =&gt; this.pickSingleWithCamera.bind(this)} style={styles.button}&gt;
                  &lt;Text style={styles.text}&gt;Select Single Image With Camera&lt;/Text&gt;
                &lt;/TouchableOpacity&gt;
  </code></pre>
  
  <p>And this is my total code </p>
  
  <pre><code>
  export default class AddPostScreen extends React.Component {
  
    pickSingleWithCamera(cropping, mediaType = 'photo') {
      ImagePicker.openCamera({
        cropping: cropping,
        width: 500,
        height: 500,
        includeExif: true,
        mediaType,
      }).then(image =&gt; {
        console.log('received image', image);
        this.setState({
          image: { uri: image.path, width: image.width, height: image.height, mime: image.mime },
          images: null
        });
      }).catch(e =&gt; alert(e));
    }
  
    pickSingleBase64(cropit) {
      ImagePicker.openPicker({
        width: 300,
        height: 300,
        cropping: cropit,
        includeBase64: true,
        includeExif: true,
      }).then(image =&gt; {
        console.log('received base64 image');
        this.setState({
          image: { uri: `data:${image.mime};base64,` + image.data, width: image.width, height: image.height },
          images: null
        });
      }).catch(e =&gt; alert(e));
    }
  
    cleanupImages() {
      ImagePicker.clean().then(() =&gt; {
        console.log('removed tmp images from tmp directory');
      }).catch(e =&gt; {
        alert(e);
      });
    }
  
    cleanupSingleImage() {
      let image = this.state.image || (this.state.images &amp;&amp; this.state.images.length ? this.state.images[0] : null);
      console.log('will cleanup image', image);
  
      ImagePicker.cleanSingle(image ? image.uri : null).then(() =&gt; {
        console.log(`removed tmp image ${image.uri} from tmp directory`);
      }).catch(e =&gt; {
        alert(e);
      })
    }
  
    cropLast() {
      if (!this.state.image) {
        return Alert.alert('No image', 'Before open cropping only, please select image');
      }
  
      ImagePicker.openCropper({
        path: this.state.image.uri,
        width: 200,
        height: 200
      }).then(image =&gt; {
        console.log('received cropped image', image);
        this.setState({
          image: { uri: image.path, width: image.width, height: image.height, mime: image.mime },
          images: null
        });
      }).catch(e =&gt; {
        console.log(e);
        Alert.alert(e.message ? e.message : e);
      });
    }
  
    pickSingle(cropit, circular = false, mediaType) {
      ImagePicker.openPicker({
        width: 500,
        height: 500,
        cropping: cropit,
        cropperCircleOverlay: circular,
        compressImageMaxWidth: 1000,
        compressImageMaxHeight: 1000,
        compressImageQuality: 1,
        compressVideoPreset: 'MediumQuality',
        includeExif: true,
      }).then(image =&gt; {
        console.log('received image', image);
        this.setState({
          image: { uri: image.path, width: image.width, height: image.height, mime: image.mime },
          images: null
        });
      }).catch(e =&gt; {
        console.log(e);
        Alert.alert(e.message ? e.message : e);
      });
    }
  
    pickMultiple() {
      ImagePicker.openPicker({
        multiple: true,
        waitAnimationEnd: false,
        includeExif: true,
        forceJpg: true,
      }).then(images =&gt; {
        this.setState({
          image: null,
          images: images.map(i =&gt; {
            console.log('received image', i);
            return { uri: i.path, width: i.width, height: i.height, mime: i.mime };
          })
        });
      }).catch(e =&gt; alert(e));
    }
  
    scaledHeight(oldW, oldH, newW) {
      return (oldH / oldW) * newW;
    }
  
    renderVideo(video) {
      console.log('rendering video');
      return (&lt;View style={{ height: 300, width: 300 }}&gt;
        &lt;Video source={{ uri: video.uri, type: video.mime }}
          style={{
            position: 'absolute',
            top: 0,
            left: 0,
            bottom: 0,
            right: 0
          }}
          rate={1}
          paused={false}
          volume={1}
          muted={false}
          resizeMode={'cover'}
          onError={e =&gt; console.log(e)}
          onLoad={load =&gt; console.log(load)}
          repeat={true} /&gt;
      &lt;/View&gt;);
    }
  
    renderImage(image) {
      return &lt;Image style={{ width: 300, height: 300, resizeMode: 'contain' }} source={image} /&gt;
    }
  
    renderAsset(image) {
      if (image.mime &amp;&amp; image.mime.toLowerCase().indexOf('video/') !== -1) {
        return this.renderVideo(image);
      }
  
      return this.renderImage(image);
    }
  
  
  
  
  render(){
  return(
  &lt;View&gt;
  
  &lt;TouchableOpacity onPress={() =&gt; this.pickSingleWithCamera.bind(this)} style={styles.button}&gt;
                  &lt;Text style={styles.text}&gt;Select Single Image With Camera&lt;/Text&gt;
                &lt;/TouchableOpacity&gt;
                &lt;TouchableOpacity onPress={() =&gt; this.pickSingleWithCamera(false, mediaType = 'video')} style={styles.button}&gt;
                  &lt;Text style={styles.text}&gt;Select Single Video With Camera&lt;/Text&gt;
                &lt;/TouchableOpacity&gt;
                &lt;TouchableOpacity onPress={() =&gt; this.pickSingleWithCamera.bind(this)} style={styles.button}&gt;
                  &lt;Text style={styles.text}&gt;Select Single With Camera With Cropping&lt;/Text&gt;
                &lt;/TouchableOpacity&gt;
                &lt;TouchableOpacity onPress={() =&gt; this.pickSingle(false)} style={styles.button}&gt;
                  &lt;Text style={styles.text}&gt;Select Single&lt;/Text&gt;
                &lt;/TouchableOpacity&gt;
                &lt;TouchableOpacity onPress={() =&gt; this.cropLast()} style={styles.button}&gt;
                  &lt;Text style={styles.text}&gt;Crop Last Selected Image&lt;/Text&gt;
                &lt;/TouchableOpacity&gt;
                &lt;TouchableOpacity onPress={() =&gt; this.pickSingleBase64(false)} style={styles.button}&gt;
                  &lt;Text style={styles.text}&gt;Select Single Returning Base64&lt;/Text&gt;
                &lt;/TouchableOpacity&gt;
                &lt;TouchableOpacity onPress={() =&gt; this.pickSingle(true)} style={styles.button}&gt;
                  &lt;Text style={styles.text}&gt;Select Single With Cropping&lt;/Text&gt;
                &lt;/TouchableOpacity&gt;
                &lt;TouchableOpacity onPress={() =&gt; this.pickSingle(true, true)} style={styles.button}&gt;
                  &lt;Text style={styles.text}&gt;Select Single With Circular Cropping&lt;/Text&gt;
                &lt;/TouchableOpacity&gt;
                &lt;TouchableOpacity onPress={this.pickMultiple.bind(this)} style={styles.button}&gt;
                  &lt;Text style={styles.text}&gt;Select Multiple&lt;/Text&gt;
                &lt;/TouchableOpacity&gt;
                &lt;TouchableOpacity onPress={this.cleanupImages.bind(this)} style={styles.button}&gt;
                  &lt;Text style={styles.text}&gt;Cleanup All Images&lt;/Text&gt;
                &lt;/TouchableOpacity&gt;
                &lt;TouchableOpacity onPress={this.cleanupSingleImage.bind(this)} style={styles.button}&gt;
                  &lt;Text style={styles.text}&gt;Cleanup Single Image&lt;/Text&gt;
                &lt;/TouchableOpacity&gt;
  
              &lt;/View&gt;
  
  )
  }
  </code></pre>
  
  <hr>
  
  <p>I am using the code from this example 
  <a href="https://github.com/ivpusic/react-native-image-crop-picker/blob/master/example/app.js" rel="nofollow noreferrer">https://github.com/ivpusic/react-native-image-crop-picker/blob/master/example/app.js</a></p>
  
  <p>So please tell me if any one know the solution.</p>
  
  <hr>