Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

Unity project with Vuforia included fails WebGL builds

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

  1. jason-vreps


    Sep 22, 2017
    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

    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

    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


    Official Vuforia Employee Vuforia

    Dec 8, 2016

    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.

    Vuforia Engine Support
  3. ptc-pmessenger


    Jan 17, 2017
    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


    Nov 25, 2014
    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.
    tonialatalo likes this.