title: Xamarin.Forms: Xamarin Essentials GetLocation() always returns null when run on Android 11
body: <p>I have a Xamarin Forms app where I am trying to get location of the phone using Xamarin Essentials. App targets Android version 11 (API 30). I have provided all the location permissions in manifest file. It works fine below Android 11 but having issue with Android 11.</p>
  <p>Every request to <code>var location = await Geolocation.GetLocationAsync(new GeolocationRequest(GeolocationAccuracy.Medium));</code> returns null.</p>
  <p>Below is the code to request permission and location:</p>
  <pre><code> private async Task locationPermission()
      {
  
          try
          {
  
              PermissionStatus whenInUsePermission = await Permissions.CheckStatusAsync&lt;Permissions.LocationWhenInUse&gt;();
              if (whenInUsePermission != PermissionStatus.Granted)
              {
                  whenInUsePermission = await Permissions.RequestAsync&lt;Permissions.LocationWhenInUse&gt;();
              }
  
              PermissionStatus locationAlwaysPermission = await Permissions.CheckStatusAsync&lt;Permissions.LocationAlways&gt;();
              if (locationAlwaysPermission != PermissionStatus.Granted)
              {
                  locationAlwaysPermission = await Permissions.RequestAsync&lt;Permissions.LocationAlways&gt;();
              }
  
              if (whenInUsePermission == PermissionStatus.Granted || locationAlwaysPermission == PermissionStatus.Granted)
              {
                  // do something
                  await GetDeviceLocation();
              }
          }
          catch (Exception ex)
          {
  
          }
      }
  
      public async Task GetDeviceLocation()
      {
          try
          {
              PermissionStatus status = await Permissions.CheckStatusAsync&lt;Permissions.LocationWhenInUse&gt;();
              if (status != PermissionStatus.Granted)
              {
                  PermissionStatus results = await Permissions.RequestAsync&lt;Permissions.LocationWhenInUse&gt;();
              }
  
              if (status == PermissionStatus.Granted)
              {
                  var location = await Geolocation.GetLocationAsync(new GeolocationRequest(GeolocationAccuracy.Medium));
  
              }
  
          }
          catch (Exception ex)
          {
  
  
          }
      }
  </code></pre>
  <p>I have given below permissions in the manifest file:</p>
  <pre><code>&lt;uses-permission android:name=&quot;android.permission.ACCESS_NETWORK_STATE&quot; /&gt;
  &lt;uses-permission android:name=&quot;android.permission.ACCESS_BACKGROUND_LOCATION&quot; /&gt;
  &lt;uses-permission android:name=&quot;android.permission.ACCESS_FINE_LOCATION&quot; /&gt;
  &lt;uses-permission android:name=&quot;android.permission.ACCESS_COARSE_LOCATION&quot; /&gt;
  &lt;uses-feature android:name=&quot;android.hardware.location&quot; android:required=&quot;false&quot; /&gt;
  &lt;uses-feature android:name=&quot;android.hardware.location.gps&quot; android:required=&quot;false&quot; /&gt;
  &lt;uses-feature android:name=&quot;android.hardware.location.network&quot; android:required=&quot;false&quot; /&gt;
  </code></pre>