Search Unity

Unity project with Vuforia included fails WebGL builds

Discussion in 'Vuforia' started by jason-vreps, Jul 12, 2019.

  1. jason-vreps

    jason-vreps

    Joined:
    Sep 22, 2017
    Posts:
    16
    First off, to address this from the get-go, I am aware that Vuforia does not support WebGL builds. We are not trying to build Vuforia into a WebGL build. The issue lies in trying to remove Vuforia from our project so that WebGL can build.

    We have a single project that ships 3 platforms: Android, iOS, and WebGL. Our Android and iOS projects have a new AR feature that we added recently, powered by Vuforia. Our whole pipeline works flawlessly here: Unity cloud build auto-builds from our project repo, and produces our Android and iOS builds. However, the WebGL build runs into a whole suite of errors due to its attempt to compile the
    VuforiaScripts.dll
    .

    Specifically:
    138: [Unity] -----CompilerOutput:-stdout--exitcode: 1--compilationhadfailure: True--outfile: Temp/VuforiaScripts.dll


    We use a pre-export script to remove all references to the Vuforia library, and remove all game objects in build-scenes that have any scripts referencing the Vuforia library. I have carefully lined all our scripts with
    #if !UNITY_WEBGL
    on the portions that relate to AR and Vuforia. Yet still, cloud build continues to attempt to compile the
    VuforiaScripts.dll
    .

    Is there something I'm missing for telling the build process to ignore Vuforia libraries?

    Using Unity 2018.3.14f1.
    Vuforia v8.1.7
     
  2. meedabit

    meedabit

    Official Vuforia Employee Vuforia

    Joined:
    Dec 8, 2016
    Posts:
    266
    Hello,

    I've raised this issue to our dev team to see if they have any feedback. I'll respond to this thread if I have any information to provide.

    Thanks,
    Vuforia Engine Support
     
  3. ptc-pmessenger

    ptc-pmessenger

    Joined:
    Jan 17, 2017
    Posts:
    4
    You'd also have to remove the entire Vuforia folder from the project (this contains scripts) as well as the Vuforia related files from the Editor folder. You may as well also remove Vuforia related files (datasets, models) from StreamingAssets and Resources while you're at it.
     
    meedabit likes this.
  4. Binary-Soul

    Binary-Soul

    Joined:
    Nov 25, 2014
    Posts:
    33
    Had the same problem and googled for answers but finally managed to easily solve it on my own. All I did is:

    - a) In my own code, keep any reference to Vuforia between #if !UNITY_WEBGL - #endif to avoid compiling it.
    - b) In Assets/Vuforia/Scripts select the "VuforiaScripts" file and in the inspector, in "Exclude Platforms" mark WebGL.

    If someone is still having trouble with it, hope it can help.
     
    Alex_F and tonialatalo like this.