Search Unity

2018.1 IL2CPP VRModule stripping issue

Discussion in 'AR/VR (XR) Discussion' started by jj-unity, Apr 27, 2018.

  1. jj-unity

    jj-unity

    Unity Technologies

    Joined:
    Jan 4, 2017
    Posts:
    74
    ++++ NOTE: this has been resolved in 2018.1.2f1 and higher ++++

    In initial 2018.1 releases, the VRModule engine code can get stripped out of builds in certain situations. If you notice that your built project doesn't correctly enter VR Mode when run, it could be due to this issue. Here are the settings where this can occur:

    1) VR is enabled.
    2) Scripting Backend is set to 'IL2CPP'.
    3) Strip Engine Code is checked. (this is the default when IL2CPP is enabled)
    4) No scripts in the project are referencing VRModule.

    In this situation, the VRModule is likely to be stripped out of the build and VR won't work. You can work around this in initial 2018.1 builds by either disabling 'Strip Engine Code', or by adding a link.xml file to the root of your project. See https://docs.unity3d.com/Manual/IL2CPP-BytecodeStripping.html for information on using link.xml to control bytecode stripping. Using link.xml is preferable as it allows other code to continue to get stripped out, reducing build size.

    Here's an example link.xml that prevents VRModule from being stripped out:

    <linker>
    <assembly fullname="UnityEngine.VRModule" preserve="all"/>
    </linker>

    This should be fixed in an upcoming 2018.1 patch release, at which point you can go ahead and remove the link.xml from your project if it isn't being used to control any other bytecode stripping.
     
    Last edited: Jun 4, 2018
    Arkade likes this.
  2. jj-unity

    jj-unity

    Unity Technologies

    Joined:
    Jan 4, 2017
    Posts:
    74
    This is fixed in 2018.1.2f1 and higher.