Cannot resolve Manifest.permission.ACCESS_FINE_LOCATION

When adding permissions to my manifest file, the below xml works.

 <permission android:name="android.permission.ACCESS_FINE_LOCATION" />

However, this xml doesn’t work.

  • adb hell command (not a typo)
  • How do I set android:layout_columnWeight=“1” programmatically to an element in an android support v7 Gridlayout
  • Create a 3d shaped button in android
  • clickable area of image
  • Frameworks detected in android studio
  • Update source activity before exit transition
  • <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

    Which one am I supposed to be using? If it’s the first one, why wouldn’t it work? How can I fix it?

    Also, I am getting an Android 6.0 runtime permissions related exception:

    java.lang.SecurityException: "gps" location provider requires ACCESS_FINE_LOCATION permission.

    When I try to add the permission to a String array in order to check the permission, Android Studio tells me it can’t resolve Manifest.permission in the below code:

    new String[]{Manifest.permission.ACCESS_FINE_LOCATION}

    Why would it be doing this? How can I fix it?

    Related posts:

    Can&#039;t delete virtual device from Eclipse, android
    Is there a way to set a base request parameter to be included in every request made with Square&...
    GL Wallpaper example only shows green screen in Emulator, but it&#039;s working in device
    How do I specify different layouts for portrait and landscape orientations?
    OkHttp Library - NetworkOnMainThreadException on simple post
    How to set text to a text view from a string.xml and normal string at a time
  • Android Butterknife - binding in fragment
  • GoogleAuthException when obtaining an access token with ClientID
  • Saving the API Key in
  • The application icon does not show on action bar
  • how to create smooth navigation drawer
  • jQuery and mobile browser compatibility?
  • 8 Solutions collect form web for “Cannot resolve Manifest.permission.ACCESS_FINE_LOCATION”

    For the first part, you should be using <uses-permission> according the the Android Devlopers site. Try making sure you declare your permissions directly under the <manifest> tag, not in your <application> tag. It’s hard to know what your problem is without seeing your entire manifest file. Check out the link I posted above for more info on how to declare permissions in your manifest.

    In regards to your runtime permissions problem:

    With uses-permissions Cannot resolve that..

    new String[]{Manifest.permission.ACCESS_FINE_LOCATION}


    Make sure you’re using android.Manifest instead of A lot of times Android Studio will default to the latter instead of the former.

    So, your new line of code would look like:

    new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION};

    Edit: I reformatted my answer.

    Edit 2: Be wary of importing android.Manifest. It can cause issues if you’re also importing Other than that import android.Manifest is another valid way to resolve this issue.

    change this


    into this


    Try this! Since ACCESS_FINE_LOCATION available in following package so Add:

    import android.Manifest;


    if you are working on dynamic permissions and any permission like ACCESS_FINE_LOCATION,ACCESS_COARSE_LOCATION giving error “cannot resolve method PERMISSION_NAME” in this case write you code with permission name and then rebuild your project this will regenerate the manifest(Manifest.permission) file

     if (Build.VERSION.SDK_INT >= 23) {
                if (checkSelfPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED
                        || checkSelfPermission(android.Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) {

    Try this before running, make sure you have permission to access..

    try {
        location = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);
    } catch (SecurityException e) {
       dialogGPS(this.getContext()); // lets the user know there is a problem with the gps

    Try this:

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && ContextCompat.checkSelfPermission(this, android.Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
            ActivityCompat.requestPermissions(this, new String[]{android.Manifest.permission.READ_EXTERNAL_STORAGE}, REQUEST_SELECT_PICTURE);

    When you type “Manifest”, Android Studio should suggest you to choose a few options of Manifest. You should choose the one start android instead of the name of your project.

    If you access the reference of and you can find there is only 1-2 lines in “Permission” class, then you are referencing the wrong manifest class.

    Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.