An Android application suddenly requires permissions not set in AndroidManifest.xml. What for?

I have an application that has had only minor changes in the last couple of years. Yesterday I released a patch for Google Play and noticed that my application suddenly needs 5 new permissions:

  • android.permission.ACCESS_COARSE_LOCATION
  • android.permission.GET_ACCOUNTS
  • android.permission.READ_EXTERNAL_STORAGE maxSdkVersion = 18
  • android.permission.USE_CREDENTIALS
  • android.permission.WRITE_EXTERNAL_STORAGE

I did not make any changes to AndroidManifest.xml, so these 5 permissions are not listed there.

I use the Google billing library (com.android.billing) for in-app purchases. This can be automatically updated by Android Studio.

I also updated these libraries:

  • com.android.support:appcompat-v7:22.1.1 โ†’ 22.2.0
  • com.android.support:support-v4:22.1.1 โ†’ 22.2.0
  • com.google.android.gms: play-services: 7.3.0 โ†’ 7.5.0

Does anyone know why this happened?

ANSWER UPDATE

@ ahmad-navaz is right, and his answer made me realize this. Here is a more detailed answer to my question:

The library that wanted additional permissions is Google Play Services .

In Google Play Services version 6.5 and later, you can (and probably should) determine which specific API you need, and not just import the entire package.

In my case, I just used play-services-analytics, so I changed this in my build.gradle

compile 'com.google.android.gms:play-services:7.5.0' 

to that

 compile 'com.google.android.gms:play-services-analytics:7.5.0' 

After this change, all 5 permissions mentioned in the original question disappeared.

The following is a complete list of selected Google Apps APIs: https://developers.google.com/android/guides/setup#split

+5
source share
1 answer

They come from the libraries you used. Android Studio integrates library permissions into an application.

+3
source

All Articles