title: flutter location , Unhandled Exception: PlatformException(PERMISSION_DENIED_NEVER_ASK, Background location permission denied forever
body: <p>I'm using <a href="https://pub.dev/packages/location" rel="nofollow noreferrer">Location</a> flutter package to access the user's background location, first time any user opens the app it asks for permission, and when the user accepts it brings back this error in the console</p>
  <pre><code>Unhandled Exception: PlatformException(PERMISSION_DENIED_NEVER_ASK, Background location permission denied forever - please open app settings, null, null)
  </code></pre>
  <p>if the user closed the app and reopened it .. it works perfectly fine ( fetches location in both foreground and background) without even asking again for location permission.</p>
  <p>Following the getting started guide in the package itself, here is how I added permission to my <code>AndroidManifest.xml</code> file :</p>
  <pre class="lang-xml prettyprint-override"><code>  &lt;uses-permission android:name=&quot;android.permission.FOREGROUND_SERVICE&quot; /&gt;
    &lt;uses-permission android:name=&quot;android.permission.ACCESS_BACKGROUND_LOCATION&quot;/&gt;
  </code></pre>