[SOLVED] Android Permissions - Read.Phone.State

bobbyck

  • Posts: 124
Okay,

I've been fighting this for a good six hours, and I've gotten nowhere so I might as well ask.

For some reason, my android build keeps adding in permissions that I do not understand why they are being asked, and which I do not want. The permission in question is, "READ_PHONE_STATE"

Whenever I upload the APK to the app store I get the following message:
Your APK or Android App Bundle is using permissions that require a privacy policy: (android.permission.READ_PHONE_STATE).

Looking through the dozens of various AndroidManifests.xml that exist, I find one in "C:\builds\MYAPPNAME\app\intermediates\manifests\full\release" that includes the following line:

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

If I delete the line out and recompile, that androidmanifest.xml file gets rebuilt and the permission request is re-added.

Any ideas ?

Thank you.

« Last Edit: August 02, 2019, 10:40:52 pm by bobbyck »


bobbyck

  • Posts: 124
Thanks Merrak,

Indeed that helped, I found the offending manifest that was injecting various permissions:

reason: com.byrobin.unityads has a targetSdkVersion < 4 uses-permission#android.permission.READ_PHONE_STATE

I opened that manifest and saw their was no "minimum" or "target" android SDK version as in all other manifests, and so I guess it was causing stencyl to target much lower android versions which included these permissions by default.

I copied / pasted from another android manifest:

    <uses-sdk
        android:minSdkVersion="19"
        android:targetSdkVersion="28" />

And it seems the build was done without any other "random" permissions added.... (here's to hoping there will be no critical failure somewhere now in the app because of my poking about in these manifests  :P )