Forum Discussion
11 Replies
- MK1_DevExplorer
I am also getting the same messages regarding read phone state and 32 bit libraries. Have never had these issues before.
- 007x007Adventurer
You can't do anything yourself. Only the author of this application.
This is a requirement of Android 11. The permission policy for READ_PHONE_STATE has been changed.
https://developer.android.com/about/versions/11/privacy/permissions?hl=en
....
"If your app targets Android 11 or higher and needs to access the phone number APIs shown in the following list, you must request the READ_PHONE_NUMBERS permission, instead of the READ_PHONE_STATE permission."
...All you can do is report the issue to the app developer so they can comply with Google's guidelines.
- UltimaVYTExplorer
Theres no solution??
- UltimaVYTExplorer
i am the app dev
- 007x007Adventurer
If Your are that app dev, then find the "Phone numbers" section on the page:
https://
developer.android.com/about/versions/11/privacy/permissions?hl=enEverything is explained in detail (with an example) what you need to do for Android 11+ 😊 Look at attached picture.
You only need to make a minor change to the AndroidManifest.xml file, compile and upload a new apk/aab file.
- jakobanarkylabsExplorer
It seems that the Unity Editor, from version 2022.3.39 and onwards, have started automatically adding some new permissions to the AndroidManifest.xml. See this post:
https://discussions.unity.com/t/unnecessary-additional-permissions-in-lts-unity-versions-2022-3-39f1/1496218
I had the same problem when trying 2022.3.40. Haven't yet tried 2022.3.41.
Maybe the best way at the moment would be to manually specify in the custom AndroidManifest.xml that the permission android.permission.READ_PHONE_STATE should be removed:<uses-permission tools:node="remove" android:name="android.permission.READ_PHONE_STATE"/>
Make sure that the manifest is including tools:
xmlns:tools="http://schemas.android.com/tools"
- jieaExplorer
This helped, tnx.
I just don't get how when I export gradle project and navigate to AndroidManifest, there is no this permission defined, but in the generated APK from it, the permission is present.
- jakobanarkylabsExplorer
Great 🙂
It is because the final AndroidManifest.xml that ends up in the built APK is a combination of many things, where just one of them is the potential custom AndroidManifest.xml in Assets/Plugins/Android/.
But all sorts of things are going on in the build process that might add various stuff to the final AndroidManifest.xml. - jakobanarkylabsExplorer
Ah, ok. I didn't understand that you were talking about the AndroidManifest created when you export to gradle project - sorry. But I guess that something is happening when the gradle project is being built.
I found this post explaining some methods for detecting the source of a permission in the final AndroidManifest: https://stackoverflow.com/a/52933901/17417673- jieaExplorer
Thanks for the reply, but this didn't help, unfortunately. I have no manifests in the project, everything is generated. No `jar` or `aar` files introduce any user permission. It seems that permissions are introduced while generating APK from gradle.
Anyway, your previous post is a good enough workaround, I just wanted to see if it is possible to skip this manual work of removing user permissions from gradle proj.
Tnx for your time!
I was getting this error while trying to push an update to my demo. What worked for me was to edit the manifest file that the Meta tool generates (in Assets/Plugins/Android/AndroidManifest.xml), and add the following line:
<uses-permission android:name="android.permission.READ_PHONE_STATE" tools:node="remove" /> as the last line before </manifest>.