Neither user nor current process has android.permission.ACCESS_COARSE_LOCATION

61,396

Solution 1

This means you have some wrong information or malformed info in your menifest file and that is the reason none of your Permission is not identified by your app. Just make sure you have cleaned ANDROIDMANIFEST file with any malformed data.

It will work and all permission should be outside Application tag

Solution 2

If you are running on a device on Android Marshmallow and above:

If the device is running Android 6.0 or higher and if the app's target SDK is 23 or higher, the app not just have to list the permissions in the manifest but also must request each dangerous permission it needs while the app is running.

More info:

http://developer.android.com/training/permissions/requesting.html

and

http://developer.android.com/guide/topics/security/permissions.html#normal-dangerous

Solution 3

move the uses-permission outside application just below the manifest tag

Solution 4

Moving permission section solved my problem with "Neither user or current process has android.permission.READ_PHONE_STATE". Thank you so much to everyone in this forum. In reference to others, my changes are bellow:

Original:

    <uses-permission android:name="android.permission.NFC" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />


    <uses-feature
        android:name="android.hardware.nfc"
        android:required="true" />

    <activity android:name=".NfcRead"></activity>
</application>

Change:

    <uses-permission android:name="android.permission.NFC" />

    <uses-feature
        android:name="android.hardware.nfc"
        android:required="true" />

    <activity android:name=".NfcRead"></activity>
</application>

<uses-permission android:name="android.permission.READ_PHONE_STATE" />

Share:
61,396
user3290805
Author by

user3290805

Updated on June 26, 2020

Comments

  • user3290805
    user3290805 almost 4 years

    I know it may be silly question and I have referred all the similar question before but unfortunately I could resolve this issue. Most probably it is problem in my Manifest.xml file.

    When I am trying to access location, app is crashing

    here is my manifest.xml

    <?xml version="1.0" encoding="utf-8"?>
     <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.test.tt.test" >
    
    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".sTest"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
    
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
    
    
        </activity>
        <service android:name="com.test.tt.test.sService">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
    
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter> </service>
        <service android:name="com.test.tt.test.sServiceRequest" />
    
        <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
        <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
        <uses-permission android:name="android.permission.ACCESS_COARSE_UPDATES" />
        <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
        <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    
    
    </application>
    

    when I run it throw this error

     java.lang.SecurityException: Neither user 11029 nor current process has android.permission.ACCESS_COARSE_LOCATION.
    

    Similar with other permissions. I can not see any mistake in my manifest file. Help appreciated

  • sivag1
    sivag1 over 7 years
    @user1147688 The first link has the example on how to request permission at the run time.
  • Bene Tleilax
    Bene Tleilax about 7 years
    Yes, it was this : "all permission should be outside Application tag".