Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

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

Discussion in '5.6 Beta' started by paramlabs, Mar 12, 2017.

  1. paramlabs

    paramlabs

    Joined:
    Aug 19, 2016
    Posts:
    8
    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.
     
  2. fredsa

    fredsa

    Joined:
    May 31, 2015
    Posts:
    19
    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.)
     
  3. joejo

    joejo

    Unity Technologies

    Joined:
    May 26, 2016
    Posts:
    958
    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

    Code (csharp):
    1.  
    2. <manifest xmlns:android="http://schemas.android.com/apk/res/android" >
    3.   <application>
    4.   </application>
    5.      <uses-feature android:name="android.software.vr.mode" />
    6. </manifest>
    7.  
    This then gets merged with the Unity generated one, and I can now successfully upload to the Play store.
     
  4. fredsa

    fredsa

    Joined:
    May 31, 2015
    Posts:
    19
    Thanks, joejo! Will give that a try
     
  5. d_v_

    d_v_

    Joined:
    Mar 16, 2017
    Posts:
    1
    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.
     
  6. joejo

    joejo

    Unity Technologies

    Joined:
    May 26, 2016
    Posts:
    958
    This is fixed in RC1
     
  7. fredsa

    fredsa

    Joined:
    May 31, 2015
    Posts:
    19
    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: https://github.com/googlevr/gvr-unity-sdk
     
  8. joejo

    joejo

    Unity Technologies

    Joined:
    May 26, 2016
    Posts:
    958
    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?
     
  9. fredsa

    fredsa

    Joined:
    May 31, 2015
    Posts:
    19
    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 https://forum.unity3d.com/threads/d...not-suppress-system-bars.457605/#post-2982412 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)
     
  10. joejo

    joejo

    Unity Technologies

    Joined:
    May 26, 2016
    Posts:
    958
    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".