naren
naren

Reputation: 15233

Android permissions are not getting updated even according to manifest.xml

Here is my android manifest.xml file

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">

    <!--<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/>-->

    <!--&lt;!&ndash; GCM connects to Internet Services. &ndash;&gt;-->
    <!--<uses-permission android:name="android.permission.INTERNET" />-->

    <!--&lt;!&ndash; GCM requires a Google account. &ndash;&gt;-->
    <!--<uses-permission android:name="android.permission.GET_ACCOUNTS" />-->

    <!--&lt;!&ndash; Keeps the processor from sleeping when a message is received. &ndash;&gt;-->
    <!--<uses-permission android:name="android.permission.WAKE_LOCK" />-->
    <!--<uses-permission android:name="com.google.android.c2dm.permission.SEND" />-->

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

    <permission android:name="com.example.ngx.surprise.permission.C2D_MESSAGE"  android:protectionLevel="signature" />

Even after commenting all permission except set wallpaper I am not able to see commented permissions go away and SET_WALLPAPER permission applied to app.

Here is the permissions screenshot of application after clean install enter image description here

Upvotes: 0

Views: 367

Answers (2)

kodartcha
kodartcha

Reputation: 1073

Set the permissions outside the application tag as @Zahidul mentioned.

Also, when you run your app, are you doing it with a clean install? With newer versions of Android Studio, due to the new Instant Run functionality it will only update the modified activities.

As permissions are checked only during the installation, with Instant Run the changes will be not applied.

Disable Instant Run in your Android Studio, o simply unistall the app before you run it again.

Hope it helps.

Upvotes: 1

Zahidul Islam
Zahidul Islam

Reputation: 3190

Permission should be under manifest . Not under application .

enter image description here

Upvotes: 2

Related Questions