9

I changed my gradle build file to use the latest Google play services version (11.8.0 -> 12.0.0) and uploaded the APK to the Google Play Console. When I tried to release, I got a warning that READ_PHONE_STATE permission had been added. If I roll back to 11.8.0, this warning disappears.

I use the following services:

implementation 'com.google.android.gms:play-services-auth:12.0.0'
implementation 'com.google.android.gms:play-services-plus:12.0.0'
api 'com.google.android.gms:play-services-maps:12.0.0'
api 'com.google.android.gms:play-services-location:12.0.0'
api 'com.google.android.gms:play-services-places:12.0.0'

It seems it was automatically added to a generated manifest.xml even though I don't need this permission (at least I didn't for play services 11.8.0). Having looked around, it seems it is an issue when a minSdk/targetSdk is not declared in an included library.

Does anyone know what is happening and how I can get rid of this permission please?

Thanks, Riz

Edit: this was marked by a moderator as an exact duplicate of Why has the READ_PHONE_STATE permission been added? . Unfortunately the solution in that question was that Play services was updated in 10.0.1 to fix this issue. It seems that version 12.0.0 reintroduces this issue so am looking for a solution.

chdryra
  • 523
  • 5
  • 17
  • I'm facing the same issue and this question shouldn't be marked as duplicate, can the one who duplicated this question tell me how this an exact duplicate of an existing question! – Ahmed Elshaer Mar 24 '18 at 23:12
  • A solution (as well mentioned in the duplicate) that works for any google play version is to add `` in your AndroidManifest.xml. I am guessing google will fix this again in 12.0.1. – Patrick Boos Mar 26 '18 at 04:28
  • I guess so, was just hoping for something less hacky. Cheers, will stick that in. – chdryra Mar 26 '18 at 17:23
  • Yes, I'm just update yesterday. And get that issue too. But is not problem I think. This one release notes for it [https://developers.google.com/android/guides/releases] (https://developers.google.com/android/guides/releases) *-license POM dependencies have no minSdkVersion / targetSdkVersion set, which means that the implied targetSdkVersion is 1. This adds READ_PHONE_STATE and READ_EXTERNAL_STORAGE permissions for apps using 12.0.0.* – Deni Rohimat Mar 28 '18 at 04:08

0 Answers0