Search Unity

Multiplatform AR/VR build

Discussion in 'Editor & General Support' started by peetonn, Jun 15, 2018.

  1. peetonn

    peetonn

    Joined:
    Jul 24, 2017
    Posts:
    5
    Platform dependent compilation solves just one part of the problem -- making your code behave differently depending on the platform.
    The other part -- exclude unnecessary libraries (and possibly assets) depending on the platform.
    Here's the problem I'm facing currently: an AR app uses ARCore. I need it to be built for desktop client (no AR, just VR, possibly different scene). When I naively try to build for desktop, of course, it gives numerous errors for ARCore, which shouldn't be used at all. How do I exclude the whole ARCore folder from desktop compilation?

    Example error:

    ```
    Assets/GoogleARCore/SDK/Scripts/Api/AnchorApi.cs(114,37): error CS0117: `GoogleARCoreInternal.ApiConstants' does not contain a definition for `ARCoreNativeApi'
    ```
     
  2. patrick_scheper

    patrick_scheper

    Joined:
    Mar 18, 2015
    Posts:
    16
    Hey! I have the same problem and created an issue on Github.

    I hope anyone here at Unity could also give their thoughts on why we get these errors even building a scene which does not use ARCore. I thought that Unity does not include files that are not being used?

    (Disabling 'ARCore Required' in the Project Settings doesn't solve this problem.)