2

My app uses a couple of permission:

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

and:
android:permission="com.google.android.c2dm.permission.SEND">

Yesterday I uploaded a new version to google play and somehow the

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

has been added and thus users won't get an auto update of my app but have to give permission first. I don't want this permission added to my project, but I have no idea how to remove it since pre-build it's not requested in my code anywhere.

Does anyone have some advice?

Rik van Velzen
  • 1,977
  • 1
  • 19
  • 37
  • 4
    you must be using library projects as dependency which require that permission and you have enabled manifestmerger property true in project properties. – Arnav M. Jan 06 '16 at 08:43
  • Indeed i found that i was using a library as dependency using the permission, There is no project.properties file though (in android studio). Im trying to figure out how to ommit the permission going through post like: http://stackoverflow.com/questions/13937123/disable-manifest-merger-in-android-gradle-build/13959122#13959122 but so far haven't been able to get it working. – Rik van Velzen Jan 06 '16 at 11:37
  • i guess you dont want to remove that property because it will make library of no use. and if you dont want the functionality from the library then just remove the library dependency and you are good to go. – Arnav M. Jan 06 '16 at 12:01

2 Answers2

6

I was able to remove the permission by adding:

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"
tools:node="remove"/>

Also @Arnav: I wasn't using any functionality of the library that needed this permission so removing caused no issues.

Rik van Velzen
  • 1,977
  • 1
  • 19
  • 37
  • I've the same problem but am facing a runtime build error of > WifiService: Neither user 10412 nor current process has permission android.permission.ACCESS_WIFI_STATE When I do a `grep -ir "ACCESS_WIFI_STATE"` I find that this permission sneaks into my final `AndroidManifest.xml`: `` – Haroon Dec 30 '21 at 20:36
1

The library projects as dependency needs to be used as this require that permission. You have enabled the manifestmerger property true in project properties () because of which this issue may occurs.

This permission can be removed as follow:

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"
tools:node="remove"/>