Unity android app not asking for permission.

Hey,

I have this

and

In my android manifest but i still need to manually go to settings->apps>app>permissions and enable it there. This is ofcourse no good if i want to get people to use it.
(the camera gets used by a plugin called vuforia)

Thanks.

I’m in the same situation. I’m writing a cardboard app that is Unity the NatCam plugin from the asset store to try to read a QR code. Its not requesting the camera permission when the app launches. If I add permissions following your steps then it works. If you figure this out I’d be interested in what your solution was.

I’m on Unity 5.6 and was testing on a Samsung Galaxy S7.

2 Likes

Same situation here for

  • Unity 2017.1f3 (OS X)
  • Minimum API level 21 (Lollipop)
  • Target API level 26 (auto, selected Oreo)

Any update on this?

NOTE: the permissions are automatically generated by Unity from using a WebcamTexture.

Manifest looks like this:

1 Like

Hi,
I just had the same issue here, when I upgrade my version of Unity from 5.5.3 to 5.6.0.
I used Vuforia and the gvr plugin from Google, my solution was to carefully remove all the residues of the old Google plugin ( gvr library permission ).
Hope it will help some of you,
Cheers.

Is there any solution to it I’m facing the same issue.

same here since last week :confused:

Solved it by changing the targetSDK to 25. Instead of highest possible sdk. So it seems the problems occurs only with targetSDK 26/android 8.0

1 Like

I’m still getting this issue and changing the target version to 25 doesn’t work for me as I’ve already selected that.
Is there any other fixes for this issue.

Same problem here. I guess I will have to implement an independent permission request subsystem like UniAndroidPermission.

I don’t know if you’re still looking for solution, but this temporary plugin work for me: Android application doesn't automaticly request for microphone permission - Questions & Answers - Unity Discussions

1 Like

try delete NatCam

The issue is resolved. :slight_smile: The following solution works for me… i think it helps you too. just put this script on camera
using UnityEngine;
using UnityEngine.Android;

public class permissionscript : MonoBehaviour
{
GameObject dialog = null;
void Start()
{
#if PLATFORM_ANDROID
if (!Permission.HasUserAuthorizedPermission(Permission.Camera))
{
Permission.RequestUserPermission(Permission.Camera);
}
#endif
}
}

// here is my device camera script

using UnityEngine;
using UnityEngine.UI;

public class simplecamera : MonoBehaviour
{
static WebCamTexture backCam;

void Start()
{
WebCamDevice[ ] devices = WebCamTexture.devices;
if(backCam == null)
{
backCam = new WebCamTexture();
}
GetComponent().texture = backCam;
backCam.Play();
}
}

2 Likes

this method works but you have to close and open again the app so camera will work