Log in or register to post comments

UnityAndroidPermissions not set correctly

August 16, 2019 - 3:34pm #1

When running an Android build for the first time (without camera permission set) my game hangs after accepting permission to use the devices camera. Looking at the permissions of the app after closing the game, I can see the camera permission was set, and any subsequent relaunch of the game runs without hanging and can use vuforia fine (I do get the same UnityAndroidPermissions error appearing in my logs tho). Using logcat I can see this message every time vuforia is initialized

"UnityAndroidPermissions was not correctly set. Please make sure you have not deleted any files in the Vuforia/Scripts/Internal directory."

I have not touched any files there (Looking at it, there is just one file, RuntimeOpenSourceInitializer). I tried removing vuforia via the packagemanager, and adding vuforia back via the package manager, but that did not fix anything. 

package manager says 8.3.9, although in logcat it is listing it as 8.3.8.

Does anyone know why my permissions are messed up?

 

AttachmentSize
Image icon 2019-08-16_15-32-28.png183.63 KB

UnityAndroidPermissions not set correctly

August 22, 2019 - 12:00pm #6

Hello @mcotora, 



I am planning on running tests on the Vuforia Core Samples, unfortunately I could not get the time to do that yet. I am actually still getting the "UnityAndroidPermissions was not correctly set" error but the camera works though, except Vuforia is not detecting any targets or displaying any AR experiences. I am also getting this error now: 

"UnityRenderingPipeline was not correctly set. Please make sure you have not deleted any files in the Vuforia/Scripts/Internal directory."

I wonder if it has anything to do with setting an actual render pipeline in Unity 2019.1 - I will definitely give that a try. But the UnityAndroidPermissions one is a confusing error, because the permissions are asked for on startup and they are given, and the camera actually works. 



I will post more updates as I test



Update:



So I am still getting those errors in the logcat console, but the reason Vuforia wasn't working or detecting any markers was a user error of mine, I just was not using the correct Vuforia license keys, now that I fixed that Vuforia works correctly, despite those messages showing up in logcat at app startup. 



When I get some time I will give the core samples a try.

UnityAndroidPermissions not set correctly

August 21, 2019 - 4:36am #5

Hi @Devastating

Thank you for the thorough post and testing.

I was curios to see if the issue also happens with the Vuforia Core Samples in your current setup. If you have time to test, please let me know the outcome.

Thank you.

Vuforia Engine Support

UnityAndroidPermissions not set correctly

August 20, 2019 - 8:23am #4

I am also having this issue after upgrading my Unity version and then subsequently getting Vuforia through the package manager, it was previously manually installed into the project. 



In the android logcat I am getting: 

2019-08-20 11:14:34.846 9366-9408/? E/Unity: UnityAndroidPermissions was not correctly set. Please make sure you have not deleted any files in the Vuforia/Scripts/Internal directory.

    Vuforia.UnityCompiled.NullUnityCompiledFacade:get_UnityAndroidPermissions()

    Vuforia.AndroidUnityPlayer:HasRequiredPermissions()

    Vuforia.VuforiaRuntime:CheckPermissions()

 

Vuforia Engine Version: 8.3.8

Vuforia Engine Unity Extension Version: 8.3.8



Unity Editor Version: 2019.2.0f1



Unity was upgraded from 2018.3.4f1



My app doesn't hang, but it doesn't display a camera view either, the camera would be all black, and even though the app was given camera permissions, I still am getting this issue. I had removed the old Vuforia folder that was manually installed in the project, after having installed Vuforia using the package manager, which then caused some conflict issues to show up in the editor log. After removing the old Vuforia installation I was able to make builds, but then the camera wouldn't load. The error says to not delete any files in Vuforia/Scripts/Internal, but I deleted all of the Vuforia folder that was previously installed, now it is in the packages folder because it was installed through Package Manager. I'm not sure what to do, any help would be greatly appreciated.



I've enabled delayed activation in Vuforia settings, and I am initializing Vuforia in the beginning of my AR scene. I also tried with delayed activation disabled, which gives the same result.



Quick Edit Update:



I've got it to work in one instance, but then it doesn't work if we close the app and open it again. On a fresh install with Delayed Activation disabled, it was able to ask for camera permissions on start up and then the camera worked, but after closing the app and opening it again, it would hang on a black screen with the "UnityAndroidPermissions was not correctly set." issue



Edit #2: 



I managed to fix it by enabling Delayed Activation again, and adding a bigger delay between the initial app start and the Vuforia initialization.

UnityAndroidPermissions not set correctly

August 20, 2019 - 5:42am #3

Hi,

I briefly tested the behavior with the Vuforia Core Samples and was *not* able to reproduce the behavior.

Could you please be provide more details regarding the hanging part? does it hang for 1-2 seconds or does your app freeze?

Could you please provide more information regarding your setup?

SDK version:

Unity version:

Android Device + OS version:

In regards to the error you are receiving, it is referencing RuntimeOpenSourceInitializer.cs in Vuforia->Scripts-> Internal. Could you please attach a copy of the script?

Thank you.

Vuforia Engine Support

FYI: I've tested with SDK: 8.3.8, Unity: 2019.1.9f, Samsung S10e and Android 9.0

UnityAndroidPermissions not set correctly

August 20, 2019 - 3:22am #2

Having the same issue right now. I've not touched the files Vuforia has set and I've this problem.

Log in or register to post comments