Search code examples
androidandroid-manifestandroid-permissions

Neither user nor current process has android.permission.ACCESS_COARSE_LOCATION


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


Solution

  • 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