Hey unity forum, I am trying to upload my game to the google play store, however it keeps stating that its asking for “read_phone_state” permissions, now I know that one cause of this is using systeminfo, so I have removed all references to systeminfo.
I also read somewhere that WWW causes the permission to be added, so removed any use of that as well.
I am using Unity analytics so was wondering if this could be the cause?
If not what are possible causes for this permission to be added, or is this just a bug on unity’s end, as I remember this permission being added by a bug in a previous version of Unity.
suffering from the same thing here…on an empty project, sure, no permission added, but on our current one, nothing gets rid of it. Tried removing all plugins, setting minSdk, everything…Unity is doing little to adress the issue.
I have seen thousands of posts talking about the similar issue. It is agreed that Unity injects additional permissions in the build phase. The thing we should ask if you ask me, is “Are there any ways to find and list the things causing that injection?”… Thus we can get rid of that part right!?..
PS: I am having the same problem in 5.3.5. It is ironic to still have it in 2017…
Hard to find what adds it without removing things step by step. We have a plugin that added it in by accident.
However, you can decompile the apk with apktool and remove it then resign/rezip - this is what we do when a plugin etc adds it in by accident. Not ideal but it should be fairly easy to automate this.
So, all of a sudden I seem to be running into this issue as well. Every time a build and install the APK file, I get prompted to allow my game to “Make and Manage Phone Calls.”
I have tried removing every instance of ‘READ_PHONE_STATE’ from every Android Manifest file in the directory. I have gone through and altered all of the Manifest files to have matching minSDK and targetSDKs.
After I build my project, I can find an instance of ‘READ_PHONE_STATE’ in the Manifest file under - *\unity\Temp\StagingArea.
I am at a loss for what to do next. Any help would be greatly appreciated.
Here is a more complete picture of what is going on:
IF Android API level is less than 4* then this permission is added.
Our Unity projects will often have more than one Android Manifest. If one of them does not specify the minimum target, it will assume API 1 which is less than 4. If it thinks you are using something less than 4, this permission is added.
If however, you are trying to put this on Google Play, and you don’t have privacy statement (and don’t want one), then the solution above is not for you. what you need to do, is to search for Android Manifest in your project and make sure that every one has a minimum API greater than 4. For example,