cancel
Showing results for 
Search instead for 
Did you mean: 

RECORD_AUDIO permission failure

mdbnet
Level 3
My app has failed submission, partly for asking for excessive user permissions.

I need to request the RECORD_AUDIO permission as my app uses the Microphone input for voice chat, and voice search.

I understand that in Marshmallow this permission was classified as a 'dangerous' permission and that dangerous permissions must be asked at run-time. But is that not what the Gear-VR permission dialog requests in VR-mode are doing? I think they are handling this correctly, requesting the permission right after launching the app.

Below is a screen shot of the Functional test failure, and you can see that it both failed and succeeded on Lolipop and Marshmallow, but on different devices. The language "App ask to recored audio" is a bit confusing. It does appear that the app does ask to record audio, so we are thinking that maybe the assumption is that the app is asking for the audio permission inappropriately.

Clearly we are asking for this permission incorrectly, but we could use a bit of direction on how to ask for it in the appropriate way.

Thanks

- David Bennett

zvi5yv2s9bn1.png
8 REPLIES 8

delphinius81
Level 8
You have the correct permissions/features listed in your manifest file, right?

Should be:
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-feature android:name="android.hardware.microphone" android:required="false" />

No system permission dialogs should appear when the user is in-app, as you can't reasonably expect a user to take the phone out to accept such a dialog at run-time.

mdbnet
Level 3
Thanks delphinus81, I didn't have that line about the microphone in the manifest.

<uses-feature android:name="android.hardware.microphone" android:required="false" />

I will try resubmitting with that. Thanks

- David Bennett

delphinius81
Level 8
I don't know that that is the reason why it was rejected, but my app uses the microphone to record user audio and it wasn't rejected. My manifest includes both of the lines I pasted above. 

UmairEm
Level 3
Helllo,

I am facing the same problem and I have no idea where these permissions come from. I don't have any permission in my main manifest file. I believe this is coming from one of plugins I am using. Any Idea how to get rid of this?

Thanks

delphinius81
Level 8
Unity will try to generate an android.manifest file for you when you build your apk based upon the calls included in your code. For example, if you have a script that calls one of Unity's Microphone functions, it will try to add the RECORD_AUDIO permission. The same holds for any plug-ins you are using - Unity will scan the function calls made by them and add permissions as needed - whether you are actually calling that code or not.

To resolve this, you'll need to either: a) Remove the plug-in (which isn't exactly feasible) or b) unpack the apk, manually modify the manifest file, and then repack the apk. 

Fulby
Level 7
The Oculus SDK used to have a microphone script (I assume the latest versions do too but haven't upgraded in a while). I deleted that script (named 'microphone' or 'voip' I think)  and the record_audio permission disappeared.

mdbnet
Level 3
If you have integrated a number of packages into your project, you may have multiple "Plugins" directories, each of which may have a "AndroidManifest.xml". You could search for all the manifests, and find one that contains the RECORD_AUDIO permission. That will tell you which library requests that permission.

mdbnet
Level 3
Adding the line about the Microphone appeared to fix the S7 Edge running Marshmallow, but not the S6 running Lollipop.

kstkymxp49rn.png