App built with VR disabled still asks to be placed in Gear VR on a Samsung

When I install my app with VR disabled on a Samsung S7 or S8 the screen asking to be placed in a Gear VR headset still gets displayed. My manifest is set up for Cardboard but it seems to me it is somehow getting changed when I go to build. What could be forcing this change? Has anybody else experienced this? I have checked my project for other Manifests that might be included with the OVR platform plugin etc that might try and merge with my manifest but cannot find any.

This is Unity 5.6.2 and 5.6.3 btw

Update: After removing the OVR Unity Utilities folder from my project I can now build non VR and Cardboard apps again, this is frustrating as I want one project to deploy to multiple VR APKs on the different platforms. I need this OVR Utilities for GearVR controller support, so at the moment it means reinstalling the packages any time I want to build to GearVR.

1 Like

Check the API order in your Player Settings. Is Oculus listed before OpenVR? If so, it may be trying to use that API first when you have OVR utilities installed.

If this is the case, move Oculus under OpenVR when you want to build for cardboard. When you want to build for Gear VR move Oculus to the top.

I don’t do much in the Mobile VR sphere so I could be way off base here, but that was my first thought when I read your post.

Thats the thing, the Oculus API isn’t even included in my VR SDK’s and it still behaves the way I described. Even with Virtual Reality Supported disabled its asks to be placed into a Gear. Something in the OVR Platform Utilities is overwriting the build setting and Manifest.

That’s strange. I have not used the OVR platform utilities but it does appear to be the culprit. I will have to have a look into it when I get the chance.

Thanks @amplifiedciaran Was getting exactly the same issue. Deleting the OVR folder did the trick.

Wrapping up all OVRManager code in a custom define directive means that I can keep the scripts in place, then switch back to GearVR (copy the OVR folder back into the project) and all works fine.
This free Custom Define Manager makes this a breeze https://www.assetstore.unity3d.com/en/#!/content/76634

For anyone still needing a fix; I’ve been on this problem for quite some time now. The fix with excluding oculus .aar files did not work for me, so i came up with a solution myself;

The problem is this line in your android manifest:

It starts the gear vr prompt on supported samsung devices. Even if you are building for cardboard, this line is in the manifest.

How to fix:

Build the app > Get output from manifest-main.xml in Temp/StagingArea > add this line inside the Tags:

OR

… Or export the whole project to android studio and go to the merged manifest, remove the value by hand.

And you’re done.

If somebody could tell oculus about this problem, that’d be nice. I’ve tried, they dont seem to care much about bugs.

I my case, we had a VR app, which we wanted to test on Samsung device with Google Cardboard and not have the GearVR dialog to pop up.

I had to add a bunch of stuff besides the just “tools:replace” or “tools:remove” to the com.samsung.android.vr.application.mode meta-data, otherwise it would not show up in the manifest and it would also remove some other things which caused the app’s icon not to not appear when installed on a device. I finally ended up with an AndroidManifest.xml that worked for me:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">
  <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:smallScreens="true" android:xlargeScreens="true" />
  <application android:allowBackup="true" android:icon="@drawable/app_icon" android:label="@string/app_name" android:supportsRtl="true" android:debuggable="false" android:isGame="true" android:banner="@drawable/app_banner" android:roundIcon="@drawable/app_icon_round" android:theme="@style/VrActivityTheme">
    <activity android:name="com.unity3d.player.UnityPlayerActivity" android:label="@string/app_name" android:screenOrientation="landscape" android:launchMode="singleTask" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale|layoutDirection|density" android:hardwareAccelerated="false">
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
        <category android:name="android.intent.category.LEANBACK_LAUNCHER" />
      </intent-filter>
      <meta-data android:name="unityplayer.UnityActivity" android:value="true" />
    </activity>
    <meta-data android:name="com.samsung.android.vr.application.mode" android:value="dual" tools:replace="android:value" />
  </application>
</manifest>
1 Like

This is still an issue and a really stupid one because it breaks even if you try to export an android app without any VR functionality and ARCore.