Android prompt for permissions in 6.0

Currently we have a project that has to be released with target sdk of 23. The project contains AR in it using vuforia, however it requires a split binary due to its size. This wouldn’t be a problem, but this does require that we have a scene that loads the target data from streaming assets and copies the files to the persistantdatapath.

However, we have run into a snag. Even when adding permission request to the manifest to get read and write storage permissions, the app never prompts the user for storage permission, which means the app stops at the title screen with the error that it can’t access the path.

Manually, I can go in and toggle the switch and the app works fine, however this isn’t the best user experience.

After digging around, I found we could force a prompt to our user. I found this guide:

Where Jason Knight has scripts that claim to work. I set up everything and tried to run it, but it gives the error
“AndroidJavaException: java.lang.ClassNotFoundException: com.noodlecake.unityplugins.NoodlePermissionGranter”

Does anybody have an idea of what I’m missing? Thank you in advance for any help you can provide.

Do you have a custom AndroidManifest? can you please show its contents (if it does not contain any sensitive information such as keys, etc).

I know that Unity has a mechanism built in that will ask for all permissions in the manifest upon startup. This can be overriden by adding this meta-data tag in your manifest:

You can try to check, perhaps you have added this by mistake.

Nope, I did check that as I saw someone mention it, so I took a look for it in the manifest and didn’t see it. The app isn’t prompting for permissions, but it doesn’t require much. The previous version of the app worked fine prior to android 6 (but also has the same problem on 6).

The project is still in 5.2.2, and we’re a bit hesitant to upgrade because it needs to be live soon (client project), but this was a problem that just showed itself due to the permission changes on android.

Thank you for that suggestion.

In case anybody is wondering about a fix.
https://github.com/sanukin39/UniAndroidPermission

This worked for me. It prompts for the permission and then can respond to a success or fail.

1 Like