title: React-Native: "TypeError: Network request failed" On Android
body: <p>I'm going crazy with this error on my Android App.</p>
  
  <p>I'm doing a signup in my app and I use the fetch method to an API that works. (I have tried to insert data with CocoaRestClient and it works!)</p>
  
  <p>I have already done the login  with the fecth and it works perfectly, but the problem is about the signup method.</p>
  
  <p>So:</p>
  
  <p><strong>Registrazione.js</strong></p>
  
  <pre><code>class Registrazione extends Component {
      constructor(props) {
          super(props);
          this.state = {
              FirstName: this.props.hasOwnProperty('FirstName') ? this.props.FirstName : '',
              LastName: this.props.hasOwnProperty('LastName') ? this.props.LastName : '',
              FiscalCode: this.props.hasOwnProperty('FiscalCode') ? this.props.FiscalCode : '',
              identity: this.props.hasOwnProperty('identity') ? this.props.identity : '',
              Email: this.props.hasOwnProperty('Email') ? this.props.Email: ''
          }
      }
      registrazione () {
          let ctrl = true;
  if(ctrl){
          if(global.isSafe){
              Actions.sceglipassword({
                  Email: this.state.Email,
                  FirstName: this.state.FirstName,
                  LastName: this.state.LastName,
                  FiscalCode: this.state.FiscalCode
              })
          }
          else{
              Actions.creazioneutente({identity: this.state.identity, FirstName: this.state.FirstName, LastName: this.state.LastName, FiscalCode: this.state.FiscalCode, Email: this.state.Email}) 
              }
                  }
      };
  </code></pre>
  
  <p>And Then I call <strong>ScegliPassword</strong> Page:</p>
  
  <pre><code>class ScegliPassword extends Component {
      constructor(props){
          super(props);
          this.state = {
              Password: '',
              PasswordRepeat: ''
          };
      }
  
  
      registrazione(){
          let ctrl = true;
          if(
              utility.isEmpty(this.state.Password) || utility.isEmpty(this.state.PasswordRepeat)){
                  ctrl = false;
                  Alert.alert("Error");
                }
  
          else if(this.state.Password != this.state.PasswordRepeat){
                  ctrl = false;
                  Alert.alert("Error");
                }
          if(ctrl)    
          {
              let identity = {
                  "APPNAME":
                          {
                              Username: this.props.FiscalCode,
                              Password: this.state.Password
                          }
              }
                  Actions.creazioneutente({identity: identity, FirstName: this.props.FirstName, LastName: this.props.LastName, FiscalCode: this.props.FiscalCode, Email: this.props.Email})
          }
      }
  </code></pre>
  
  <p>Then there is an action to <strong>CreazioneUtente</strong></p>
  
  <pre><code>class CreazioneUtente extends Component {
      constructor(props)
      {
          super(props)
      }
  
      creaUtenza(){
          Utente.creaUtente(this.props.identity, this.props.FirstName, this.props.LastName, this.props.FiscalCode, this.props.Email)
  
          .then((data) =&gt; {
              global.utente = new Utente(data)
          })
          .catch((err) =&gt; {
              console.log(err)
          })
      }
  </code></pre>
  
  <p>And there I call the <strong>Utente</strong>.creaUtente</p>
  
  <pre><code>static creaUtente(identity, FirstName, LastName, FiscalCode , Email) {
          let formdata = new FormData();
          formdata.append('Identity', identity);
          formdata.append('FirstName', FirstName);
          formdata.append('LastName', LastName);
          formdata.append('FiscalCode', FiscalCode);
          formdata.append('Email', Email);
  
          console.log(Configuration.base_url.rest + Configuration.apiRoutes.signUp)
          console.log(formdata)
  
          return new Promise((resolve, reject)=&gt; {
              fetch(Configuration.base_url.rest + Configuration.apiRoutes.signUp , {
                  method: 'POST',
                  headers: {
                      'Content-Type': 'multipart/form-data',
                  },
                  body: formdata
              })
              .then((response) =&gt; response.json())
              .then((responseData) =&gt; {
                  if(responseData.Error){
                      Alert.alert("Errore");
                  }
                  global.utente = responseData;
                  resolve(responseData)
              })
              .catch((err) =&gt; {reject(err)})
          })
      }
  </code></pre>
  
  <p>In the fecth I pass the link of the API for the signup (it's an https://***.com link)</p>
  
  <p>Now if I print the "formdata" in console log, I receive the correct data that I have inserted with the form.</p>
  
  <p>this is my AndroidManifest.xml</p>
  
  <pre><code>&lt;application
        android:name=".MainApplication"
        android:label="@string/app_name"
        android:icon="@mipmap/ic_launcher"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:allowBackup="false"
        android:theme="@style/AppTheme"
          xmlns:tools="http://schemas.android.com/tools"
          android:usesCleartextTraffic="true"
          tools:ignore="GoogleAppIndexingWarning"&gt;
          &lt;uses-library
            android:name="org.apache.http.legacy"
            android:required="false" /&gt;
        &lt;activity
          android:name=".MainActivity"
          android:label="@string/app_name"
          android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
          android:windowSoftInputMode="adjustResize"&gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.MAIN" /&gt;
              &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
          &lt;/intent-filter&gt;
        &lt;/activity&gt;
        &lt;activity android:name="com.facebook.react.devsupport.DevSettingsActivity" /&gt;
      &lt;/application&gt;
  </code></pre>
  
  <p>When I try to do the signup, I receive this kind of error (in my console):</p>
  
  <pre><code>{ _parts: 
  [ [ 'Identity',
  { "APPNAME": { Username: 'TNNFRZ77H01G273V', Password: '12345' } } ],
  [ 'FirstName', 'Fabrizio' ],
  [ 'LastName', 'Tonno' ],
  [ 'FiscalCode', 'TNNFRZ77H01G273V' ],
  [ 'Email', 'Fabrizio.tonno@email.com' ] ] }
  { [TypeError: Network request failed]
  line: 24122,
  column: 31,
  sourceURL: 'http://localhost:8081/index.bundle?platform=android&amp;dev=true&amp;minify=false' }
  </code></pre>
  
  <p>I don't know how solve this problem... 
  Can you help me? Thank you.</p>