title: Error in uploading image with 'react-native-image-picker' library
body: <p>I am creating an android application and I need to use the <code>react-native-image-picker</code> library but it is showing some error, the error is:</p>
  <blockquote>
  <p>[Unhandled promise rejection: TypeError: null is not an object (evaluating '_reactNative.NativeModules.ImagePickerManager.launchImageLibrary')]</p>
  </blockquote>
  <p>I have tried everything like changing to different versions as well, also I have used <code>expo-image-picker</code> which does not show an error while fetching an image from android but gives an error when uploading it to firebase.</p>
  <p>Please help, I have been frustrated with this error.</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>import {
    View,
    Text,
    Image,
    StyleSheet,
    KeyboardAvoidingView,
    TouchableOpacity,
    ActivityIndicator
  } from "react-native";
  import React, { useState } from "react";
  import { TextInput, Button } from "react-native-paper";
  import ImagePicker, { launchImageLibrary } from "react-native-image-picker";
  import storage from "@react-native-firebase/storage";
  import auth from '@react-native-firebase/auth';
  import firestore, {getStorage, ref, uploadBytes} from '@react-native-firebase/firestore';
  
  export default function SignUp({ navigation }) {
    const [name, setName] = useState("");
    const [email, setEmail] = useState("");
    const [password, setPassword] = useState("");
    const [image, setImage] = useState(null);
    const [shownext, setShownext] = useState(false);
    const [loading, setLoading] = useState(false);
  
    if (loading) {
      return &lt;ActivityIndicator size='large' /&gt;
    }
  
    const userSignUp = async () =&gt; {
      setLoading(true)
      if (!email || !password || !image || !name) {
        alert('fill all details correctly')
        return false;
      }
      try {
        const result = await auth().createUserWithEmailAndPassword(email, password);
      firestore().collection('users').doc(result.user.uid).set({
        name: name,
        email: result.user.email,
        uid: result.user.uid,
        pic:image
      })
        setLoading(false)
    }catch (err) {
        alert('something went wrong from your side')
      }
      }
  
    const pickImageAndUpload = () =&gt; {
      console.log(1);
      launchImageLibrary({ puality: 0.5 }, async (fileobj) =&gt; {
          console.log(2);
          console.log(fileobj);
          const uploadTask = storage().ref().child(`/userprofilepic/${Date.now()}`).putFile(fileobj.uri);
        uploadTask.on(
          "state_changed",
          (snapshot) =&gt; {
            const progress =
              (snapshot.bytesTransferred / snapshot.totalBytes) * 100;
            if (progress == 100) alert("image uploaded");
          },
          (error) =&gt; {
            alert("error uploading image");
          },
          () =&gt; {
            getDownloadURL(uploadTask.snapshot.ref).then((downloadURL) =&gt; {
              setImage(downloadURL);
            });
          }
        );});
    };
  
    return (
      &lt;KeyboardAvoidingView behavior="position" style={{ alignItems: "center" }}&gt;
        &lt;View style={styles.box1}&gt;
          &lt;Text style={styles.text}&gt;Welcome to chatapplication&lt;/Text&gt;
          &lt;Image style={styles.img} source={require("../assets/wa-logo.png")} /&gt;
        &lt;/View&gt;
        {!shownext &amp;&amp; (
          &lt;&gt;
            &lt;TextInput
              style={{ width: 330, marginTop: 50, marginBottom: 30 }}
              label="Email"
              value={email}
              mode="outlined"
              onChangeText={(text) =&gt; setEmail(text)}
            /&gt;
            &lt;TextInput
              style={{ width: 330, marginBottom: 30 }}
              label="Password"
              value={password}
              mode="outlined"
              onChangeText={(text) =&gt; setPassword(text)}
              secureTextEntry
            /&gt;
          &lt;/&gt;
        )}
  
        {shownext ? (
          &lt;&gt;
            &lt;TextInput
              style={{ width: 330, marginTop: 50, marginBottom: 30 }}
              label="Name"
              value={name}
              mode="outlined"
              onChangeText={(text) =&gt; setName(text)}
            /&gt;
            &lt;Button
              style={{ marginBottom: 30 }}
              mode="contained"
              onPress={() =&gt; { pickImageAndUpload() }}
            &gt;
              Upload Profile Pic
            &lt;/Button&gt;
            &lt;Button
              disabled={image?false:true}
              mode="contained"
              onPress={() =&gt; { userSignUp() }}&gt;
              SignUp
            &lt;/Button&gt;
          &lt;/&gt;
        ) : (
            &lt;Button
              // disabled={email&amp;&amp;password?false:true}
            mode="contained"
            onPress={() =&gt; {
              setShownext(true);
            }}
          &gt;
            Next
          &lt;/Button&gt;
        )}
        &lt;TouchableOpacity onPress={() =&gt; navigation.goBack()}&gt;
          &lt;Text style={{ margin: 10, textAlign: "center", fontSize: 18 }}&gt;
            Already have an account?
          &lt;/Text&gt;
        &lt;/TouchableOpacity&gt;
      &lt;/KeyboardAvoidingView&gt;
    );
  }
  
  const styles = StyleSheet.create({
    text: {
      fontSize: 22,
      color: "green",
      margin: 20,
    },
    img: {
      width: 200,
      height: 200,
    },
    box1: {
      alignItems: "center",
    },
  });</code></pre>
  </div>
  </div>
  </p>