0

I follow the tutorial here to receive location updates from my app. I added the ACCESS_FINE_LOCATION permission to AndroidManifest.xml like so:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.user.myapplication" >
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
</manifest>

However, I still get the following error:

java.lang.SecurityException: Client must have ACCESS_FINE_LOCATION permission to request PRIORITY_HIGH_ACCURACY locations.

Please help me fix this.

raul
  • 1,209
  • 7
  • 20
  • 36
  • Are you running it in an emulator? If you are, please specify the Android version your emulator is running. It may be M, and if that's the case I know there've been some changes in permission management. – Paulo Avelar Sep 13 '15 at 20:57
  • There are some similar questions. Check this: http://stackoverflow.com/questions/32552170/google-play-services-client-must-have-access-fine-location-permission-to-reques and this: https://commonsware.com/blog/2015/08/31/hey-where-did-my-permission-go.html – Oğuzhan Döngül Sep 13 '15 at 20:59
  • @PauloAvelar YES! Yes it is! – raul Sep 13 '15 at 20:59
  • Please check the question linked by oguzhand, it points to another question that talks about Android M. Either way, this could also help: http://code.tutsplus.com/articles/understanding-permissions-in-android-m--cms-24443. – Paulo Avelar Sep 13 '15 at 21:30

0 Answers0