Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Making the AndroidManifest camera permission optional

Discussion in 'Android' started by aarons, Jun 17, 2020.

  1. aarons

    aarons

    Joined:
    Aug 15, 2013
    Posts:
    5
    I've got a problem with one of my apps since updating to Unity2019, hope someone here might be able to help.

    My app uses WebCamTexture, which as the docs state, adds the camera permission to the AndroidManifest:
    Code (CSharp):
    1. <uses-permission android:name="android.permission.CAMERA"/>
    This is fine, however since the update to 2019 it's also adding this:
    Code (CSharp):
    1. <uses-feature android:name="android.hardware.camera" android:required="true"/>
    This causes a problem for me as when the camera is required like this, it makes my app invalid for Chromebooks when trying to upload the APK to Google Play console. I need the required parameter to be false.

    Is there any way of making the required parameter for this false from Unity?

    I've already tried overriding the AndroidManifest as outlined here: https://docs.unity3d.com/Manual/android-manifest.html to no avail.

    I'm hoping there's a way of doing this that doesn't involve me having to unpack/modify/repack the APK after a build.
     
  2. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,682
  3. aarons

    aarons

    Joined:
    Aug 15, 2013
    Posts:
    5
    Thanks, I'll try that out. I initially suspected that the Vuforia SDK that I'm using might be the cause of this, but even when I removed that completely and rebuilt the project the permission was still required.