Forum Discussion

dev-adam's avatar
dev-adam
Member
10 months ago
Solved

Unwanted AndroidManifest Permissions Programmatically Added By Unity During APK Build Process

Any updated methods to remove the permissions automatically added by Unity (which are unneeded by my app)?

Talking about this issue in particular: https://communityforums.atmeta.com/t5/Unity-Development/Your-manifest-includes-the-following-permissions-restricted-by/m-p/960334#M20612

Here's another "magical" way to fix it: https://skarredghost.com/2021/03/24/unity-unwanted-audio-permissions-app-lab/

  • I also wrote up how I got around the AndroidManifest Unity bug by editing the manifest file if it helps anyone:
    https://www.stornaway.io/tech-tip-when-meta-quest-developer-hub-objects-to-android-permission-read_phone_state/

    It is crazy that this is still a thing.

    For search: The error reported by Meta Quest Developer Hub says:
    ERROR:
    • The upload could not be completed because your application contains the following Android permissions that are not supported:
    – android.permission.READ_PHONE_STATE
    Please remove the following permissions and upload your application binary again.

    It also contains the following complaint for permissions currently added by Unity despite using a custom manifest:
    Your manifest includes the following permissions restricted by Oculus:
    – android.permission.WRITE_EXTERNAL_STORAGE
    – android.permission.READ_EXTERNAL_STORAGE
    – android.permission.READ_MEDIA_AUDIO
    – android.permission.READ_MEDIA_VIDEO
    – android.permission.READ_MEDIA_IMAGES
    – android.permission.ACCESS_MEDIA_LOCATION
    – android.permission.READ_MEDIA_IMAGE
    These are not blocked up front in the same way as READ_PHONE_STATE above, but with a standard app you will need to remove these before submitting to the store in order for your app to be accepted.



3 Replies

  • I also wrote up how I got around the AndroidManifest Unity bug by editing the manifest file if it helps anyone:
    https://www.stornaway.io/tech-tip-when-meta-quest-developer-hub-objects-to-android-permission-read_phone_state/

    It is crazy that this is still a thing.

    For search: The error reported by Meta Quest Developer Hub says:
    ERROR:
    • The upload could not be completed because your application contains the following Android permissions that are not supported:
    – android.permission.READ_PHONE_STATE
    Please remove the following permissions and upload your application binary again.

    It also contains the following complaint for permissions currently added by Unity despite using a custom manifest:
    Your manifest includes the following permissions restricted by Oculus:
    – android.permission.WRITE_EXTERNAL_STORAGE
    – android.permission.READ_EXTERNAL_STORAGE
    – android.permission.READ_MEDIA_AUDIO
    – android.permission.READ_MEDIA_VIDEO
    – android.permission.READ_MEDIA_IMAGES
    – android.permission.ACCESS_MEDIA_LOCATION
    – android.permission.READ_MEDIA_IMAGE
    These are not blocked up front in the same way as READ_PHONE_STATE above, but with a standard app you will need to remove these before submitting to the store in order for your app to be accepted.



    • dev-adam's avatar
      dev-adam
      Member

      It is odd that this is still an issue. Your solution is super simple so thank you for that. I went down a rabbit hole of unpacking the APK and then resigning it which was a huge waste of time.

  • Also make sure the Android API is  34 or higher, that was the issue for me, that I had to fix after implementing the solution listed here

     

→ Find helpful resources to begin your development journey in Getting Started

→ Get the latest information about HorizonOS development in News & Announcements.

→ Access Start program mentor videos and share knowledge, tutorials, and videos in Community Resources.

→ Get support or provide help in Questions & Discussions.

→ Show off your work in What I’m Building to get feedback and find playtesters.

→ Looking for documentation?  Developer Docs

→ Looking for account support?  Support Center

→ Looking for the previous forum?  Forum Archive

→ Looking to join the Start program? Apply here.

 

Recent Discussions