Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

webgl exception

Discussion in 'Unity 5 Pre-order Beta' started by kryptopath2, Oct 30, 2014.

  1. kryptopath2

    kryptopath2

    Joined:
    Jul 19, 2013
    Posts:
    104
    hi,
    i started a testscene with just 2 spheres and an unlit material. on webgl-export i get the compiler error:


    Internal compiler error. See the console log for more information. output was:
    Unhandled Exception: System.Reflection.ReflectionTypeLoadException: The classes in the module cannot be loaded.

    at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (bool)

    at System.Reflection.Assembly.GetTypes () [0x00000] in <filename unknown>:0

    at Mono.CSharp.RootNamespace.ComputeNamespaces (System.Reflection.Assembly assembly, System.Type extensionType) [0x00000] in <filename unknown>:0

    at Mono.CSharp.RootNamespace.ComputeNamespace (Mono.CSharp.CompilerContext ctx, System.Type extensionType) [0x00000] in <filename unknown>:0

    at Mono.CSharp.GlobalRootNamespace.ComputeNamespaces (Mono.CSharp.CompilerContext ctx) [0x00000] in <filename unknown>:0

    at Mono.CSharp.Driver.LoadReferences () [0x00000] in <filename unknown>:0

    at Mono.CSharp.Driver.Compile () [0x00000] in <filename unknown>:0

    at Mono.CSharp.Driver.Main (System.String[] args) [0x00000] in <filename unknown>:0

    any ideas?

    thx for help :)
     
  2. GabrieleUnity

    GabrieleUnity

    Unity Technologies

    Joined:
    Sep 4, 2012
    Posts:
    116
    Hello,

    could you please submit the faulty project using the bug reporter and paste the case number here? We will look at it as soon as we can and fix it for one of the upcoming betas.

    Thanks,
    Gabriele
     
  3. kryptopath2

    kryptopath2

    Joined:
    Jul 19, 2013
    Posts:
    104
    thanks for the reply, the casenumber is 644059
     
  4. GabrieleUnity

    GabrieleUnity

    Unity Technologies

    Joined:
    Sep 4, 2012
    Posts:
    116
  5. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936
    After investigating this bug, it looks like the PlayMaker code is trying to use UnityEngine.NetworkPlayer, which is not supported in WebGL. Unity is not doing a very good job of reporting the error, IMO. If I dig into the Editor.log file, just above the TypeLoadException, I see this:

    -----CompilerOutput:-stdout--exitcode: 1--compilationhadfailure: True--outfile: Temp/Assembly-CSharp.dll
    The class UnityEngine.NetworkPlayer could not be loaded, used in UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
    The class HutongGames.PlayMaker.FsmEventData could not be loaded, used in PlayMaker, Version=1.6.0.0, Culture=neutral, PublicKeyToken=null
    The class HutongGames.PlayMaker.Fsm could not be loaded, used in PlayMaker, Version=1.6.0.0, Culture=neutral, PublicKeyToken=null
    The class HutongGames.PlayMaker.Fsm could not be loaded, used in PlayMaker, Version=1.6.0.0, Culture=neutral, PublicKeyToken=null
    The class HutongGames.PlayMaker.FsmState could not be loaded, used in PlayMaker, Version=1.6.0.0, Culture=neutral, PublicKeyToken=null
    The class HutongGames.PlayMaker.Fsm could not be loaded, used in PlayMaker, Version=1.6.0.0, Culture=neutral, PublicKeyToken=null
    The class BitConverter could not be loaded, used in PlayMaker, Version=1.6.0.0, Culture=neutral, PublicKeyToken=null
    The class HutongGames.PlayMaker.FsmStateAction could not be loaded, used in PlayMaker, Version=1.6.0.0, Culture=neutral, PublicKeyToken=null
    The class HutongGames.PlayMaker.Fsm could not be loaded, used in PlayMaker, Version=1.6.0.0, Culture=neutral, PublicKeyToken=null
    The class PlayMakerFSM could not be loaded, used in PlayMaker, Version=1.6.0.0, Culture=neutral, PublicKeyToken=null
    The class PlayMakerFSM could not be loaded, used in PlayMaker, Version=1.6.0.0, Culture=neutral, PublicKeyToken=null


    In the PlayMaker code, this access to UnityEngine.NetworkPlayer is usually inside a #if like this:

    Code (CSharp):
    1. #if !(UNITY_FLASH || UNITY_NACL || UNITY_METRO || UNITY_WP8)
    I think that the code should be changed to this:

    Code (CSharp):
    1. #if !(UNITY_FLASH || UNITY_NACL || UNITY_METRO || UNITY_WP8 || UNITY_WBEGL)
    simply adding UNITY_WEBGL to the list of exclusions.

    So at least initially, I don't think this is a bug we can correct on the Unity side.
     
  6. kryptopath2

    kryptopath2

    Joined:
    Jul 19, 2013
    Posts:
    104
    thanks for your help!
     
  7. Alex-Chouls

    Alex-Chouls

    Joined:
    Mar 24, 2009
    Posts:
    2,663
    @kryptopath2 Are you using the Playmaker 1.8.0 beta? Did you import PlayMakerNACL.unitypackage into your test project? Networking is stripped from that version. All actions should already have UNITY_WEBGL in the list of exclusions...