title: Xamarin HttpClient crash on first boot on Android
body: <p>Hello everyone I'm writing a cross platform app that need to get some data from a url endpoint, here is the method:</p>
  
  <pre><code> /// &lt;summary&gt;
          /// Ottiene tutte le informazioni visualizzabili nell'applicazione
          /// &lt;/summary&gt;
          /// &lt;returns&gt;&lt;/returns&gt;
          public async Task ottieniInformazioniAsync() {
  
              if (contentDownloaded)
                  return;
  
  
              Action action = () =&gt; { ottieniInformazioniAsync(); };
  
              this.wrapper = await PersistanceStorage.PersistanceStorage.Instance.getInformations();
  
              if (wrapper == null)
                  await App.showAwaitableMessage("Si è verificato un errore nell'ottenimento delle informazioni.", "Errore", "Riprova", action);
              else
                  contentDownloaded = true;
  
              this.wrapper.generaOggetto(this);
  
          }
  </code></pre>
  
  <p>The app start crashing where I'm calling the  *PersistanceStorage.PersistanceStorage.Instance.getInformations();*method, here is the body:</p>
  
  <pre><code>/// &lt;summary&gt;
          /// Ottiene tutte le informazioni dalla base di dati
          /// &lt;/summary&gt;
          /// &lt;returns&gt;&lt;/returns&gt;
          public async Task&lt;InformationContainer.InformationWrapper&gt; getInformations() {
  
              var url = URLREST + "/getInformazioni";
              var request = await requestData(url);
              if (request.IsSuccessStatusCode)
              {
                  try
                  {
                      var content = await request.Content.ReadAsStringAsync();
                      var wrapper = JsonConvert.DeserializeObject&lt;InformationCallWrapper&gt;(content);
  
                      return wrapper.data;
  
                  }
                  catch (Exception e)
                  {
                      Debug.WriteLine("Errore download informazioni" + e);
  
                  }
              }
  
              return null;
          }
  </code></pre>
  
  <p>only when I'm running the app on android, and only in the first run of the app everything crash calling the  <em>await requestData(url); method:</em></p>
  
  <pre><code> /// &lt;summary&gt;
      /// Effettua una richiesta http ad una risorsa
      /// &lt;/summary&gt;
      /// &lt;returns&gt;The data.&lt;/returns&gt;
      /// &lt;param name="url"&gt;URL.&lt;/param&gt;
      public async Task&lt;HttpResponseMessage&gt; requestData(String url)
      {
          var uri = new Uri(string.Format(url, string.Empty));
          try
          {
              return await RestClient.GetAsync(uri);
          }
          catch (Exception e) {
              Debug.WriteLine(e);
              return null;
          }
  
      }
  </code></pre>
  
  <p>Here is the stack trace:</p>
  
  <pre><code>    [Mono] Loading reference 2 of System.Net.Http.dll asmctx DEFAULT, looking for System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
  [Mono] Assembly Ref addref System.Net.Http[0x74a6364880] -&gt; System.Core[0x74ade3bb00]: 11
  [capitale.ctsap] 0xebadde09 skipped times: 0
  [mono-rt] /proc/self/maps:
  [mono-rt] 12c00000-12f80000 rw-p 00000000 00:01 19984                              /dev/ashmem/dalvik-main space (region space)_3233_3233 (deleted)
  [mono-rt] 12f80000-13080000 ---p 00380000 00:01 19984                              /dev/ashmem/dalvik-main space (region space)_3233_3233 (deleted)
  [mono-rt] 13080000-13180000 rw-p 00480000 00:01 19984                              /dev/ashmem/dalvik-main space (region space)_3233_3233 (deleted)
  [mono-rt] 13180000-134c0000 rw-p 00580000 00:01 19984                              /dev/ashmem/dalvik-main space (region space)_3233_3233 (deleted)
  [mono-rt] 134c0000-13540000 ---p 008c0000 00:01 19984                              /dev/ashmem/dalvik-main space (region space)_3233_3233 (deleted)
  [mono-rt] 13540000-13580000 rw-p 00940000 00:01 19984                              /dev/ashmem/dalvik-main space (region space)_3233_3233 (deleted)
  [mono-rt] 13580000-13940000 ---p 00980000 00:01 19984                              /dev/ashmem/dalvik-main space (region space)_3233_3233 (deleted)
  [mono-rt] 13940000-13980000 rw-p 00d40000 00:01 19984                              /dev/ashmem/dalvik-main space (region space)_3233_3233 (deleted)
  [mono-rt] 13980000-14080000 ---p 00d80000 00:01 19984                              /dev/ashmem/dalvik-main space (region space)_3233_3233 (deleted)
  [mono-rt] 14080000-140c0000 rw-p 01480000 00:01 19984                              /dev/ashmem/dalvik-main space (region space)_3233_3233 (deleted)
  [mono-rt] 140c0000-14100000 ---p 014c0000 00:01 19984                              /dev/ashmem/dalvik-main space (region space)_3233_3233 (deleted)
  [mono-rt] 14100000-2ac00000 rw-p 01500000 00:01 19984                              /dev/ashmem/dalvik-main space (region space)_3233_3233 (deleted)
  [mono-rt] 6f28d000-6f567000 rw-p 00000000 fe:01 79                                 /data/dalvik-cache/arm64/system@framework@boot.art
  [mono-rt] 6f567000-6f57d000 r--p 002da000 fe:01 79                                 /data/dalvik-cache/arm64/system@framework@boot.art
  [mono-rt] 6f57d000-6f6b2000 rw-p 00000000 fe:01 89                                 /data/dalvik-cache/arm64/system@framework@boot-core-libart.art
  [mono-rt] 6f6b2000-6f6c4000 r--p 00135000 fe:01 89                                 /data/dalvik-cache/arm64/system@framework@boot-core-libart.art
  [mono-rt] 6f6c4000-6f704000 rw-p 00000000 fe:01 98                                 /data/dalvik-cache/arm64/system@framework@boot-conscrypt.art
  [mono-rt] 6f704000-6f707000 r--p 00040000 fe:01 98                                 /data/dalvik-cache/arm64/system@framework@boot-conscrypt.art
  [mono-rt] 6f707000-6f74e000 rw-p 00000000 fe:01 103                                /data/dalvik-cache/arm64/system@framework@boot-okhttp.art
  [mono-rt] 6f74e000-6f752000 r--p 00047000 fe:01 103                                /data/dalvik-cache/arm64/system@framework@boot-okhttp.art
  [mono-rt] 6f752000-6f7b8000 rw-p 00000000 fe:01 114                                /data/dalvik-cache/arm64/system@framework@boot-bouncycastle.art
  [mono-rt] 6f7b8000-6f7bf000 r--p 00066000 fe:01 114                                /data/dalvik-cache/arm64/system@framework@boot-bouncycastle.art
  [mono-rt] 6f7bf000-6f820000 rw-p 00000000 fe:01 117                                /data/dalvik-cache/arm64/system@framework@boot-apache-xml.art
  [mono-rt] 6f820000-6f827000 r--p 00061000 fe:01 117                                /data/dalvik-cache/arm64/system@framework@boot-apache-xml.art
  [mono-rt] 6f827000-6f86b000 rw-p 00000000 fe:01 121                            
  
      /data/dalvik-cache/arm64/system@framework@boot-ext.art
  [libc] Fatal signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0x7fe3f58cf0 in tid 24999 (capitale.ctsapp), pid 24999 (capitale.ctsapp)
  </code></pre>
  
  <p>I don't get why the crash happen only on the first boot and only on Android platform, maybe is some permission or nugget missing? </p>