Unity Android IAP keeps adding READ_PHONE_STATE permission, and I just can't remove it

I’m almost finishing a simple arcade game I’ve been developing for Android, and I’m currently trying to add a “Remove Ads” feature, which you pay $0,99 to remove the advertisements that occasionaly appear after you lose the game. The ads were pretty easy to implement, but the Unity In App Purchase is really giving me headaches.

The problem is that, no matter what I do, every damn time I import the Unity IAP to the project and build the APK file, the READ_PHONE_STATE permission will be added in there. I don’t want this permission in there because, firstly, it’s unneccessary for the purchases to work, and secondly, it may make users distrust my game: “If it’s just a simple game, why is it asking for allowance to make and manage phone calls??” — And I wouldn’t blame them, it’s a very reasonable suspicion.

I’ve been googling around this issue during the entire day and I tried all the solutions I found in the Forums and Answers pages (changing AndroidManifest.xml files, changing target/minimum SDKs, downloading different versions of Unity IAP plugin, etc.), but unfortunately I had no success. So I’m opening a new thread here in order to see if I can get some new information that may help me out. The only way I found to remove it is to delete the entire IAP plugin for my project and then build the APK, but that’s obviously not a valid solution and misses my initial purposes entirely.

How can I remove READ_PHONE_STATE permission from my game? Why isn’t there a feature that allows me to manage permissions?

1 Like

Also try steps 2 and 3 here: https://answers.unity.com/questions/1433115/android-how-to-remove-read-phone-state.html?childToView=1474277#answer-1474277

Step 2 didn’t work.

And I can’t export the project to Gradle, all tutorials talk about the “Build System” option in the Build Settings window, but it’s not in there.

Which Unity version are you using?

5.3.1f1

Then Gradle should be the “Google Android Project” tick, AFAIK.

Yeah, I already tried using that and it does create the project. But I’m unable to build an APK with Android Studio or even directly with Gradle on the command prompt.

The furthest I reached was creating a JAR file that dosen’t even run in my computer.

Hmm, if upgrading your project to at least Unity 5.6 is not an option (for Gradle Build System), then I’m out of ideas. I hope someone can point you in the right direction.

Did you manage to remove the permission? I’m facing the same issue.

READ_PHONE_STATE permission may pop up unexpectedly if one of your plugins is missing targetSdkVersion in its manifest. Try searching your plugins’ manifests and fix it. (Unity IAP should work correctly).

More detailed description:

@Yury-Habets got the same issue after upgrading from IAP version 1.12 to 1.17. Nothing else was changed. Move back to previous commit with IAP 1.12 - everything is fine, but after upgrade to 1.17 got READ_PHONE_STATE permission in my manifest.

But version 1.16 doesn’t add READ_PHONE_STATE permission.

Please test with IAP 1.20, we made some changes in this area.

1 Like

I’m using latest Unity and latest IAP plugin and I can’t remove Phone permission. I don’t want to upload to Xiomi store then why do I need UnityChannel folder???

Please see the previous post by Yury-Habets. I suspect that although IAP itself does not require the permission, it may be triggering a scan of the project and finding assets that have not set the targetSdkVersion.

@JeffDUnity3D Hi, it was coming from Chartboost SDK in the project. Thanks for your help.

Since upgrading to Unity IAP v1.21.0 and the UDP addition our APK is being injected with the READ_PHONE_STATE permission. I’ve just unzipped the file udp.aar file and found the permission listed in the manifest file. How can we stop this infecting our main apps manifest file??

Do you need the UDP feature?

No I don’t even know what it is to be honest. We haven’t used it and haven’t changed any settings to use it. I’ve simply updated the Unity IAP package from the asset store.

To temporarily get around the issue I’ve had to manually extract the udp.aar file, remove the READ_PHONE_STATE from the manifest and then rezip the aar file. Will this be fixed in an update, or another suggested way to fix it perhaps? thanks.

As mentioned, there was no need for you to update to this package. My understanding is that READ_PHONE_STATE is required in China markets (UDP). The suggested way to fix it is to not use this version in your app. You can download previous versions here: