thedigitalsean thedigitalsean - 1 year ago 86
Android Question

ACCESS_FINE_LOCATION AndroidManifest Permissions Not Being Granted

I am trying to utilize GPS in Android (2.2 and 2.3) but am getting the following error when I try to use the LocationManager object:

WARN/System.err(522): java.lang.SecurityException: Provider network requires ACCESS_FINE_LOCATION or ACCESS_COARSE_LOCATION permission

I have researched the issue in other posts and they are typically due to issues with AndroidManifest.xml. However, mine appears to be fine:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android=""
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".GetLocation"
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<uses-permission android:name="android.permisssion.ACCESS_FINE_LOCATION"></uses-permission>
<uses-permission android:name="android.permisssion.ACCESS_COARSE_LOCATION"></uses-permission>
<uses-permission android:name="android.permisssion.INTERNET"></uses-permission>

Here is the offending line of code in my onCreate method in the GetLocation Activity, encased in a try/catch block:

LocationManager locManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE);
final LocationListener locListener = new MyLocListener();

locManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, locListener);
catch (SecurityException se){

This is the first app I have written where I need to request android permissions and have so far been unsuccessful in being granted any permissions whatsoever. Is there something I am missing in my manifest or perhaps in my eclipse configuration?

Answer Source

You misspelled permission

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download