Unity 5.6.0f3 doesn't ask for Android microphone permission when VR is enabled

Hi. I’ve stumbled across an issue regarding permissions in Android. More specifically The microphone permission.

I’m using Unity 5.6.0f3 with “Virtual Reality Supported” checked and “Cardboard” as choosen sdk.

When running the app on a device the app never checks for Microphone usage permission. When “Virtual Reality Supported” is unchecked the app correctly asks for permission to use the microphone.
The permissions can be manually set using Settings->Apps->AppName->Permissions on the device.

I’m not very experienced in Android development, but when trying to add the microphone usage permission in the AndroidManifest the app just crashed on startup.

Am I doing something wrong, or have I stumbled upon a bug?

Best regards, Linus.

2 Likes

Do you have crash log information from logcat? Can you post the manifest you made to manually ask for permissons?

Seeing the manifest would help. For Cardboard, it should look similar to Assets/Plugins/Android/AndroidManifest-Cardboard.xml.

1 Like

Hello,

I have similar issue. Did you ever get this solved ?

Thanks

Also running into this issue, 2017.1f1. Any progress? For the record, manifest looks as follows.

<?xml version="1.0" encoding="utf-8" standalone="no"?><manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="preferExternal" package="com.Sigtrap.Homie360" platformBuildVersionCode="27" platformBuildVersionName="8.1.0">
    <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:smallScreens="true" android:xlargeScreens="true"/>
    <application android:allowBackup="true" android:banner="@drawable/app_banner" android:debuggable="false" android:icon="@drawable/app_icon" android:isGame="true" android:label="@string/app_name" android:supportsRtl="true" android:theme="@style/VrActivityTheme">
        <activity android:configChanges="fontScale|keyboard|keyboardHidden|layoutDirection|locale|mcc|mnc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode" android:label="@string/app_name" android:launchMode="singleTask" android:name="com.unity3d.player.UnityPlayerActivity" android:screenOrientation="landscape">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
                <category android:name="android.intent.category.LEANBACK_LAUNCHER"/>
                <category android:name="com.google.intent.category.CARDBOARD"/>
            </intent-filter>
            <meta-data android:name="unityplayer.UnityActivity" android:value="true"/>
        </activity>
        <meta-data android:name="unityplayer.SkipPermissionsDialog" android:value="true"/>
        <meta-data android:name="unity.build-id" android:value="e0851923-05ad-4542-94d2-497d7aa14219"/>
        <meta-data android:name="unity.splash-mode" android:value="0"/>
        <meta-data android:name="unity.splash-enable" android:value="false"/>
    </application>
    <uses-feature android:glEsVersion="0x00020000"/>
    <uses-feature android:name="android.hardware.vulkan" android:required="false"/>
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.RECORD_AUDIO"/>
    <uses-feature android:name="android.hardware.microphone" android:required="true"/>
    <uses-feature android:name="android.hardware.touchscreen" android:required="false"/>
    <uses-feature android:name="android.hardware.touchscreen.multitouch" android:required="false"/>
    <uses-feature android:name="android.hardware.touchscreen.multitouch.distinct" android:required="false"/>
</manifest>

Note that I’ve manually set the microphone required to true in there just to see if it had any effect, but it doesn’t.

I also ran into this issue. I was able to work around it by using the GitHub - Over17/UnityAndroidPermissions: Unity Android Runtime Permissions for Android Marshmallow library to manually request the RECORD_AUDIO permission.

1 Like