title: Unhandled Exception: PlatformException(PERMISSION_DENIED, Access to location data denied, null, null) |Andriod |Flutter
body: <p>I am trying to get the user current location, but when I and click on get location button it gives me this error. I am running this on android.</p>
  <p>I have added all dependencies.</p>
  <p>Here is my code</p>
  <pre><code>class App extends StatefulWidget {
    @override 
    _AppState createState() =&gt; _AppState(); 
  }
  
  class _AppState extends State&lt;App&gt; {
  
    String _locationMessage = &quot;&quot;; 
  
    void _getCurrentLocation() async {
  
      final position = await Geolocator().getCurrentPosition(desiredAccuracy: LocationAccuracy.high);
      print(position);
  
      setState(() {
        _locationMessage = &quot;${position.latitude}, ${position.longitude}&quot;;
      });
  
    }
  
  
    // This widget is the root of your application.
    @override
    Widget build(BuildContext context) {
      return MaterialApp(
        title: 'Flutter Demo',
        home: Scaffold(
          appBar: AppBar(
            title: Text(&quot;Location Services&quot;)
          ),
          body: Align(
              child: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              children: &lt;Widget&gt;[
              Text(_locationMessage), 
              FlatButton(
                onPressed: () {
                    _getCurrentLocation();
                },
                color: Colors.green,
                child: Text(&quot;Find Location&quot;)
              )
            ]),
          )
        )
      );
    }
  }
  
  </code></pre>
  <p>i added this on <strong>pubspec.yaml</strong> file</p>
  <pre><code>  geolocator: ^5.1.5
  </code></pre>
  <p>and this on <strong>AndriodManifest.xml</strong> file</p>
  <pre><code>&lt;uses-permission android:name=&quot;android.permission.ACCESS_COARSE_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_BACKGROUND_LOCATION&quot; /&gt;
  </code></pre>
  <p>Please help if anyone know how to fix it.</p>