[Unhandled promise rejection: TypeError: Network request failed] 오류 발생 이유

firebase와 연동해서 코딩중입니다만 특정 행동을 할때만 하기와 같은 오류가 발생합니다.

게시판에 파일을 첨부하지 않고 게시글만 쓰고 포스팅버튼을 눌렀을때 발생하는데요…
원인이 무엇인지 궁금합니다.

아래 제가 작성한 파일 참고용으로 붙여드립니다.

import React, { Component } from “react”;

import {

View,

Text,

TouchableOpacity,

StyleSheet,

LayoutAnimation,

SafeAreaView,

TextInput,

Image,

Modal,

TouchableWithoutFeedback,

Keyboard,

} from “react-native”;

import { NavigationContainer, TabActions } from “@react-navigation/native”;

import { Foundation, SimpleLineIcons } from “@expo/vector-icons”;

import Contants from “expo-constants”;

import * as Permissions from “expo-permissions”;

import Fire from “./Fire”;

import * as ImagePicker from “expo-image-picker”;

import { FontAwesome } from “@expo/vector-icons”;

const firebase = require(“firebase”);

require(“firebase/firestore”);

export default class PostScreen extends Component {

static navigationOptions = ({ navigation }) => {

const { params = {} } = navigation.state;

};

state = {

text: "",

image: undefined,

};

componentDidMount() {

this.getPhotoPermission();

}

getPhotoPermission = async () => {

if (Contants.platform.ios) {

  const { status } = await Permissions.askAsync(Permissions.CAMERA_ROLL);

  if (status != "granted") {

    alert("We need to permission to access your camera roll");

  }

}

};

handlePost = () => {

Fire.shared

  .addPost({ text: this.state.text.trim(), localUri: this.state.image })

  .then((ref) => {

    this.setState({ text: "", image: undefined });

    this.props.navigation.goBack();

  })

  .catch((error) => {

    console.log("Api call error");

    alert(error);

  });

};

pickImage = async () => {

let result = await ImagePicker.launchImageLibraryAsync({

  mediaTypes: ImagePicker.MediaTypeOptions.Images,

  allowsEditing: true,

  aspect: [4, 3],

});

if (!result.cancelled) {

  this.setState({ image: result.uri });

}

};

render() {

LayoutAnimation.easeInEaseOut();

return (

  <TouchableWithoutFeedback onPress={Keyboard.dismiss}>

    <SafeAreaView style={styles.container}>

      <View style={styles.header}>

        <TouchableOpacity onPress={() => this.props.navigation.goBack()}>

          <Foundation name="arrow-left" color={"black"} size={32} />

        </TouchableOpacity>

        <TouchableOpacity onPress={this.handlePost}>

          <Text>Post</Text>

        </TouchableOpacity>

      </View>

      <View style={styles.inputContainer}>

        <FontAwesome name="user-circle-o" color={"#bbb"} size={27} />

        {/*

        --------프로필 이미지 임의지정한것

        <Image

          source={require("./src/img/chima.png")}

          style={styles.avatar}

        />

        */}

        <TextInput

          autoFocus={true}

          multiline={true}

          numberOfLines={4}

          style={{ flex: 1, marginLeft: 10 }}

          placeholder="게시물을 입력하세요."

          onChangeText={(text) => this.setState({ text })}

          value={this.state.text}

        ></TextInput>

      </View>

      <TouchableOpacity style={styles.photo} onPress={this.pickImage}>

        <SimpleLineIcons name="camera" color={"black"} size={32} />

      </TouchableOpacity>

      <View style={{ marginHorizontal: 32, marginTop: 32, height: 150 }}>

        <Image

          source={{ uri: this.state.image }}

          style={{ width: "100%", height: "100%" }}

        />

      </View>

    </SafeAreaView>

  </TouchableWithoutFeedback>

);

}

}