Search Unity

NetworkManager is stripped in UWP builds

Discussion in 'Multiplayer' started by demonixis, Jun 20, 2018.

  1. demonixis

    demonixis

    Joined:
    Aug 20, 2013
    Posts:
    185
    Hello,

    We're working on a multiplayer game that targets only Windows Store. The game is developped using Unity 2018.1.5. Everything works well in the editor, but in build, we can't access to NetworkManager because it was stripped during the build. I've checked many capabilities (Internet Client / Server / Personal Network), but it doesn't change anything. I know that many guys use UNET with UWP project so I guess I've to enable a specific setting?

    - Unity Version: 2018.1.5
    - Windows Version: 10 Spring Creator Update
    - Visual Studio: 2017 Community, up to date
    - IL2CPP (I can't use .Net because the project uses the Post processing stack V2, which is not compatible with UWP/.Net)
    - .Net Standard 2.0 and 4.x + Standard 2.0 tested with the same result
     
  2. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936
    Does this project have engine code stripping enabled? If so, it might be worth trying with that option disabled.
     
  3. demonixis

    demonixis

    Joined:
    Aug 20, 2013
    Posts:
    185
    Yes it's enabled, but it's indicated that this feature is always on when using IL2CPP, so I didn't try to uncheck it. I'll try.
     
  4. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936
    The terminology can be a bit confusing, as there are two different types of "code stripping" which Unity does. Managed bytecode stripping removes unused IL bytecode from managed assemblies in the project. This is always enabled with IL2CPP.

    Engine code stripping examines the components used in each scene in the build and removes any native engine code components which are not in use. Engine code stripping can be disabled with IL2CPP, but is enabled by default.

    Note if disabling engine code stripping makes things work, we might still have a bug. We need to determine why the NetworkManager was removed, as it should be detected and preserved if it is used by something in the project.
     
  5. demonixis

    demonixis

    Joined:
    Aug 20, 2013
    Posts:
    185
    The result is the same unchecking code stripping

    Code (CSharp):
    1. [0,310223 / 3,551341] - AppCallbacks::Load
    2. [1,050163 / 3,564728] - Starting to load first level
    3. The following GlobalManagers were stripped from the build (Either because they're not used or not supported on this platform):
    4.  NetworkManager
    5.  MasterServerInterface
    6.  ClusterInputManager
    7.  UnityAnalyticsManager
    8.  CrashReportManager
    9.  PerformanceReportingManager
    Do you know a Unity version which works with UNET?

    Can I try to use link.xml with the following content?

    Code (CSharp):
    1. <linker>
    2.        <assembly fullname="UnityEngine.Networking" preserve="all"/>
    3. </linker>
     
    Last edited: Jun 20, 2018
  6. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936
    I'm pretty unfamiliar with UNET, sorry. Maybe someone else can comment though.
     
  7. demonixis

    demonixis

    Joined:
    Aug 20, 2013
    Posts:
    185
    Thanks for your help, I'm going to try many things and many Unity versions, including betas..