Search Unity

Thread class not found when building for Windows Store/Phone

Discussion in 'Editor & General Support' started by StealThePixels, Dec 27, 2015.

  1. StealThePixels

    StealThePixels

    Joined:
    Apr 2, 2015
    Posts:
    68
    I've built my game for PC standalone, Mac and Android with no issues.

    When building for Windows 8.1 i get compiler errors saying

    - Thread class not found
    - NetworkView class not found
    - GetMethod and GetFields methods not found in System.Type

    See screenshots of my Build settings and compiler errors.

    What am i missing?

    p.s. I'm using Unity 5.1.1 01.png 02.png
     
  2. StealThePixels

    StealThePixels

    Joined:
    Apr 2, 2015
    Posts:
    68
    Solved: i had to change some code because some .NET featureas are not available on Windows Store/phone
     
  3. Mejiora

    Mejiora

    Joined:
    Sep 29, 2014
    Posts:
    14
    Can you say what specifically you changed in regards to the Thread class and GetMethod and GetFields? I have battled with the same issue all day :/
     
  4. StealThePixels

    StealThePixels

    Joined:
    Apr 2, 2015
    Posts:
    68
    About thread class: i just used coroutines
    About NetworkView : it is specific to the Hell Lava package, i just commented out the code which uses that class since i did not need multiplayer network support by Hell Lava
    About GetMethods and GetFields i don't remember now but i can point you to this question which is about the same issue with reflection on Windows Phone http://stackoverflow.com/questions/14061291/portable-class-library-and-reflection

    P.S. If you have to use System.Threading.Thread to do just a Sleep , you can do the same with this line
    new WaitForSeconds(0.2f); // sleeps for 200 ms
     
  5. StealThePixels

    StealThePixels

    Joined:
    Apr 2, 2015
    Posts:
    68
    This is a useful comment from that link
     
  6. Mejiora

    Mejiora

    Joined:
    Sep 29, 2014
    Posts:
    14
    Thanks a bunch! I'm not using threads for sleeping, but this should point me in the right direction :). Thanks again for the quick response.