Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question Getting namespace name 'Multiplay' does not exits error during android build

Discussion in 'Game Server Hosting' started by ZeusK10, Mar 17, 2023.

  1. ZeusK10

    ZeusK10

    Joined:
    Jun 29, 2021
    Posts:
    1
    Multiplayer.png
    To achieve functionality as shown in image, I was able to use matchmaker to allocate and join player to a running session or a new server session but I found the matchmaking process to be unreliable (maybe i did it wrong). When I matchmake in Game1, matchmaker sometimes creates a new server even though there is enough available slots in running session (I have backfill enabled) and sometimes it joins a session for game2 even when i clearly selected game1 (i think it has something to do with relaxations but i get error when i remove it so idk what else to do). So how do I properly implement matchmaker to get the result as shown in the image?

    I also want to know if it is possible to join players to the server when they start the game and create/join the lobby for each game session to achieve this functionality?

    My game also builds fine when i build in windows but when i try to build with android, i get this error: error CS0234: The type or namespace name 'Multiplay' does not exist in the namespace 'Unity.Services' (are you missing an assembly reference?).
    I have tried re-installing multiplay package and also tried regenerating project files with git packages enabled in external tools.
     
    Last edited: Apr 3, 2023
    Ariba2000 likes this.
  2. Ariba2000

    Ariba2000

    Joined:
    Jan 26, 2019
    Posts:
    1
    the solution on this link might be helpful.
    it's the same problem.
     
  3. ANLevant

    ANLevant

    Joined:
    Jun 10, 2014
    Posts:
    32
    TL;DR: Multiplay module isn't exported into android builds, wrap your Multiplay code with #if UNITY_SERVER #endif to only be present when compiling game servers
     
  4. AlexaRebecca

    AlexaRebecca

    Joined:
    Dec 14, 2018
    Posts:
    26
    i try that but not fixed
     
    ANLevant likes this.
  5. ANLevant

    ANLevant

    Joined:
    Jun 10, 2014
    Posts:
    32
    Yo u need to wrap your multiplay code in #if UNITY_SERVER #endif tags. ANd also you need to wrap the imports refering to Multiplay (as I mentioned, those libraries are not imported into the android buld, so you have to keep that to you serve'r's code.