Search Unity

Exclude un-necessary DLLs from WebGL build

Discussion in 'Web' started by ypoeymirou, Jan 20, 2017.

  1. ypoeymirou

    ypoeymirou

    Joined:
    Jul 31, 2015
    Posts:
    54
    Hi,

    When building a WebGL project, these DLLs are added to the build while I don't need them :

    C:/Program Files/Unity5.5.0p1/Editor/Data/UnityExtensions/Unity/UnityHoloLens/RuntimeEditor/UnityEngine.HoloLens.dll
    C:/Program Files/Unity5.5.0p1/Editor/Data/UnityExtensions/Unity/UnityHoloLens/Runtime/UnityEngine.HoloLens.dll
    C:/Program Files/Unity5.5.0p1/Editor/Data/UnityExtensions/Unity/PlaymodeTestsRunner/UnityEngine.PlaymodeTestsRunner.dll
    C:/Program Files/Unity5.5.0p1/Editor/Data/UnityExtensions/Unity/Advertisements/UnityEngine.Advertisements.dll
    C:/Program Files/Unity5.5.0p1/Editor/Data/UnityExtensions/Unity/UnityAnalytics/UnityEngine.Analytics.dll
    C:/Program Files/Unity5.5.0p1/Editor/Data/UnityExtensions/Unity/UnityPurchasing/UnityEngine.Purchasing.dll

    As well as these, while I imagine they could make more sense (depending on what "Networking" features they serve)

    C:/Program Files/Unity5.5.0p1/Editor/Data/UnityExtensions/Unity/Networking/UnityEngine.Networking.dll
    C:/Program Files/Unity5.5.0p1/Editor/Data/UnityExtensions/Unity/Networking/Standalone/UnityEngine.Networking.dll

    Is there a way to remove it from the build ?

    Thanks,

    Yvan
     
    yuliyF likes this.
  2. MicroEyes

    MicroEyes

    Joined:
    Jul 3, 2012
    Posts:
    309
    Is there any solution to this? I am seeing the same issue.
     
  3. Schubkraft

    Schubkraft

    Unity Technologies

    Joined:
    Dec 3, 2012
    Posts:
    1,073
    If you are not using any of them they will not be included in your build automatically if you enabled "strip engine code" in the Player Settings (enabled by default).
     
  4. jRocket

    jRocket

    Joined:
    Jul 12, 2012
    Posts:
    700
    Check "Disable HW Statistics" in your build settings(pro only).
     
  5. CARVER

    CARVER

    Joined:
    Jun 10, 2014
    Posts:
    2
    Doing so has no effect, I even tested this on a blank project with no scripts or assets. After the build the managed data folder is bloated with unnecessary and unused libraries. This is really starting to frustrate me.
     
  6. Schubkraft

    Schubkraft

    Unity Technologies

    Joined:
    Dec 3, 2012
    Posts:
    1,073
    In order to receive some actual help you'd need to be more specific:

    What version are you using? What are theses libraries that end up in your data folder?
     
  7. CARVER

    CARVER

    Joined:
    Jun 10, 2014
    Posts:
    2
    I am using 2017.3.1.1f1. The libraries showing up in my build folder that I know I do not need include:

    UnityEngine.ARModule
    UnityEngine.Networking
    UnityEngine.PerformanceReportingModule
    UnityEngine.Timeline
    UnityEngine.UNETModule
    UnityEngine.UnityAnalyticsModule
    UnityEngine.UnityConnectModule
    UnityEngine.VehiclesModule
    UnityEngine.VRModule

    I have tried removing these references from the solution explorer but the assemblies still show up in my build. I don't understand why you can't manually specify which assemblies to include in a build or why the engine isn't stripping these unused assemblies after compiling. My game does not support AR or VR, these are useless. My game is also single player, networking of any kind is useless. I don't even know what the vehicles module is for but assuming I know what it is for, it is useless to me. I am not too aware of the Performance Reporting Module but I already have my own error and performance reporting system that my studio uses in all of our software, so this is also useless to me as well unless this is to send information to your side.

    Edit:
    I also have analytics disabled for my project (Windows standalone build by the way), so why is that module being included? I am also using Unity Personal for now, I just switched from 4.5 Pro. So far it has been an amazing experience, besides this little bloating issue. Also why is the UnityPlayer.dll showing up in my base folder? Is it possible to relocate this to another location?
     
    Last edited: Mar 16, 2018
  8. roka

    roka

    Joined:
    Sep 12, 2010
    Posts:
    598
    The logic should be to have a listview and be able to check/uncheck in function of what we need .... especially by playing with the asset bundle
     
  9. Schubkraft

    Schubkraft

    Unity Technologies

    Joined:
    Dec 3, 2012
    Posts:
    1,073
    When making a WebGL build you will not end up with DLLs in you build folder. The Build folder will contain several files ending on *.unityweb (code, framework, memory, data) so something seems to be off.

    If you are however making a Windows Standalone build then you are correct with your assumptions since that doesn't support the stripping of these yet. Sorry.
     
  10. BerengerVolumiq

    BerengerVolumiq

    Joined:
    Feb 6, 2017
    Posts:
    14
    How can you check what part of Unity is included in your build when strip engine is enabled ? In the editor log right after the build ?
     
  11. Schubkraft

    Schubkraft

    Unity Technologies

    Joined:
    Dec 3, 2012
    Posts:
    1,073
    After your build finishes go to http://files.unity3d.com/build-report/ and click the button. This should then load a page that shows you what is in your build and ideally also what referenced it.

    We have plans to bring this info into the editor in the future.
     
    kevin-masson likes this.
  12. BerengerVolumiq

    BerengerVolumiq

    Joined:
    Feb 6, 2017
    Posts:
    14
    Neat, thank you :)