Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

iOS Multiplayer :: Argument cannot be null

Discussion in 'Multiplayer' started by sakamoto1147, Jan 29, 2016.

  1. sakamoto1147

    sakamoto1147

    Joined:
    Dec 10, 2015
    Posts:
    1
    I'm going to make Multiplayer move at an end in iOS, but the following error is shown and doesn't move well.

    ------------------------

    ArgumentNullException: Argument cannot be null.


    Parameter name: baseUri

    at System.Uri.Merge (System.Uri baseUri, System.String relativeUri) [0x00000] in <filename unknown>:0

    at UnityEngine.Networking.Match.NetworkMatch.ListMatches (UnityEngine.Networking.Match.ListMatchRequest req, UnityEngine.Networking.Match.ResponseDelegate`1 callback) [0x00000] in <filename unknown>:0


    (Filename: currently not available on il2cpp Line: -1)

    ------------------------

    The processing which is being performed is the following source.

    NetworkMatch networkMatch;

    void Awake()
    {
    networkMatch = gameObject.AddComponent<NetworkMatch>();
    }

    void OnGUI()
    {

    if (GUILayout.Button ("Listrooms")) {
    networkMatch.ListMatches (0, 20, "", OnMatchList);
    }

    }

    public void OnMatchList(ListMatchResponse matchListResponse)
    {
    if (matchListResponse.success && matchListResponse.matches != null)
    {

    }
    }




    I moved with no problem in Mac,Android.

    A countermeasure is requested.

     
  2. ILGSupreme

    ILGSupreme

    Joined:
    Jun 8, 2015
    Posts:
    1
    I have also recieved the same error to the same platform as you, no problem in pc , mac, or andriod
     
  3. valyard

    valyard

    Unity Technologies

    Joined:
    Jun 4, 2010
    Posts:
    291
    Hi, we are looking at this issue but right now you can do this to fix it:
    Code (CSharp):
    1. NetworkManager.matchMaker.baseUri = new System.Uri("https://mm.unet.unity3d.com/");
     
    booferei likes this.
  4. pacdan

    pacdan

    Joined:
    Apr 23, 2013
    Posts:
    2
    I added the line above and still get the same error. I put it right before the call to ListMatches, like this:

    (I start the MatchMaker earlier, then get here when requested for a list of matches.)

    if (networkManager.matchMaker != null)
    {
    networkManager.matchMaker.baseUri = new System.Uri("https://mm.unet.unity3d.com/");
    networkMatch.ListMatches(0, 20, "", OnMatchList);
    Debug.Log("Gettinglistofmatches.");
    }

    Is this the correct usage? Do I need to wait and check that baseUri was set?
     
  5. Max_power1965

    Max_power1965

    Joined:
    Oct 31, 2013
    Posts:
    127
    Have you solved this issue? I'm having the same problem!
     
  6. jimmio92

    jimmio92

    Joined:
    Nov 3, 2009
    Posts:
    31
    I solved this by setting a password.

    Super late to the party, sorry!