Bug: 5.6.0.b11 does not set android.software.vr.mode in APK. Unable to upload in Daydream

We have noticed a bug in Unity Beta 5.6.0.b11 wherein even if the Android manifest file has correct VR mode set and also in Unity the VR mode is set, the generated APK file does not include following uses-feature tag.
android.software.vr.mode

Due to this, when you upload the APK to Daydream store, it does not allow uploading due to missing tag.

To add, the specific error message seen when attempting to upload a Unity 5.6.0b11 built Daydream VR app to the Play Store is:

Upload failed
APK contains Daydream intent. To qualify for Daydream, update your APK to include the android.software.vr.mode uses-feature tag.

The missing AndroidManifest.xml tag is:

<uses-feature android:name="android.software.vr.mode" />

(Note, that this uses-feature tag is not missing if the same using Unity 5.4.2f2-GVR13.)

This is a known issue in the current beta and will be fixed in RC1. It is possible for you to make your own little manifest file that includes this one feature request and have it be merged in to resolve this issue for now.
Adding the simplest manifest possible into Plugins/Android/AndroidManifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android" >
  <application>
  </application>
     <uses-feature android:name="android.software.vr.mode" />
</manifest>

This then gets merged with the Unity generated one, and I can now successfully upload to the Play store.

Thanks, joejo! Will give that a try

I tried the above solution, with no success.
Instead, export the project as Android project.
Open the project with Android Studio.
Edit the AndroidManifest.
Build and run.

This is fixed in RC1

Thanks, Joejo. Looking forward to RC1!

d_v_, it seems the snippet joejo provided in #3 as a workaround doesn’t contain quite enough of the XML to work, although it does fix the missing uses-feature element.

What did work for me (Unity 5.6.0b11) is taking the contents of the AndroidManifest-Daydream.xml from the GVR SDK (I used the file from the current version: 1.30.0), appended |layoutDirection to end of the list of values that file has for the activity’s android:configChanges and added the missing <uses-feature android:name="android.software.vr.mode" android:required="false" />.

All of that goes into Plugins/Android/AndroidManifest.xml and effectively merges:

  1. Mostly working template Daydream manifest
  2. Fix for fullscreen / system bar suppression requirement (by adding `layoutDirection’)
  3. Fix for missing android.software.vr.mode

Doing this means I can build using Unity.

1.30.0 GVR SDK *.unitypackage is of course here: GitHub - googlevr/gvr-unity-sdk: Google VR SDK for Unity

I’m interested in this >> 2. Fix for fullscreen / system bar suppression requirement (by adding `layoutDirection’)

What are you seeing or experiencing that is requiring that?

That layoutDirection is a change I noticed between AndroidManifest.xml files generated between 5.6.0b9 and b11 (I didn’t try b10), using the ‘Android export’ checkbox:

b9:
android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale"

b11:
android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale|layoutDirection"

I sort of guessed this was the fix described in Daydream bug causing Google Play rejection: "The app does not suppress system bars" - Unity Engine - Unity Discussions where Charles quoted the b11 release notes describing this issue:

  • VR: Fixed issue with NavBar visibility that was causing Daydream apps to fail Play Store submission. (885518)

However "|layoutDirection" is not currently in the AndroidManifest-Daydream.xml template in the GVR 1.30.0 SDK *.unitypackage (https://github.com/googlevr/gvr-unity-sdk/blob/master/GoogleVRForUnity.unitypackage)

Ahh… no that isn’t the fix for that. The only fix for that is a code fix and that will be in the next release (RCX). I don’t have a date on that other than “soon”.