Search Unity

Resolved Parameter name null when new Account()

Discussion in 'Vivox (Voice & Text Chat)' started by smartandwise, Dec 16, 2022.

  1. smartandwise

    smartandwise

    Joined:
    Jul 18, 2022
    Posts:
    6
    hello

    I was using vivox without any error
    but today suddenly i got this error when setting new Account(displayname);
    and I can't login.

    Code (CSharp):
    1. ArgumentNullException: Value cannot be null.
    2. Parameter name: name
    3. VivoxUnity.AccountId..ctor (System.String issuer, System.String name, System.String domain, System.String displayname, System.String[] spokenLanguages, System.String environmentId) (at Library/PackageCache/com.unity.services.vivox@15.1.180000-pre.1/Runtime/VivoxUnity/AccountId.cs:75)
    4. Unity.Services.Vivox.Account..ctor (System.String displayname, System.String[] spokenLanguages) (at Library/PackageCache/com.unity.services.vivox@15.1.180000-pre.1/Runtime/Account.cs:9)
    5. VivoxVoiceManager.Login (System.String displayName) (at Assets/Samples/Vivox/15.1.180000-pre.1/Chat Channel Sample/Assets/ChatChannelSample/Scripts/Vivox/VivoxVoiceManager.cs:198)
    6. RoomManager.OnSceneLoaded (UnityEngine.SceneManagement.Scene scene, UnityEngine.SceneManagement.LoadSceneMode loadSceneMode) (at Assets/Scripts/RoomManager.cs:102)
    7. UnityEngine.SceneManagement.SceneManager.Internal_SceneLoaded (UnityEngine.SceneManagement.Scene scene, UnityEngine.SceneManagement.LoadSceneMode mode) (at <4746c126b0b54f3b834845974d1a9190>:0)
    8.  

    in Account.cs
    Code (CSharp):
    1. VivoxService.Instance.PlayerId ?? Guid.NewGuid().ToString(),
    reason is VivoxServece.Instance.PlayerId is not null but empty
    so name dosen't set correctly

    I can't find who set the PlayerId

    I just changed editor version 3.12 to 3.16 and didn't change script
    Changed back to 3.12 but error was same

    new vivox sample project in 3.16 works fine and has PlayerId

    Please help.
     
  2. chanddu

    chanddu

    Joined:
    Jun 13, 2016
    Posts:
    7
    Hello,
    Is it working for you? we were facing issues with the Android, new version is not working fine Vivox 1.9.Lemme know if u figured this,tq.
    Regards,
    Chandu.
     
  3. smartandwise

    smartandwise

    Joined:
    Jul 18, 2022
    Posts:
    6
    No still struggling.

    If I set credentials(server, domain, issuer, key) directly in script It works on editor and some device,
    but some device dosen't work and get Parameter name Null error.

    If I get credentials from await AuthenticationService.Instance.SignInAnomymouslyAsync(),
    I get Parameter AccessToken null error because fail on authenticate vivox service initialize.
     
  4. chanddu

    chanddu

    Joined:
    Jun 13, 2016
    Posts:
    7
    Hi,
    Try this version "15.1.180001-pre.5"
     
  5. smartandwise

    smartandwise

    Joined:
    Jul 18, 2022
    Posts:
    6
    Deleting Library folder dosen't work so I exported entire package and imported to new project
    and it's working now.
    I was too lazy to test changed version but thank you:)
     
    chanddu likes this.
  6. djhatvr

    djhatvr

    Joined:
    Sep 22, 2019
    Posts:
    53
    Changing version fixed my issue which is different.
    Thanks @chanddu!
     
  7. z08840

    z08840

    Joined:
    Nov 27, 2015
    Posts:
    1
    there is a bug in com.unity.services.vivox@15.1.180000-pre.1\Runtime\Account.cs

    Code (CSharp):
    1.             base
    2.             (
    3.                 VivoxService.Instance.Issuer,
    4.                 VivoxService.Instance.PlayerId ?? Guid.NewGuid().ToString(),
    5.                 VivoxService.Instance.Domain,
    6.                 displayname,
    7.                 spokenLanguages,
    8.                 VivoxService.Instance.EnvironmentId
    9.             )
    replace with

    Code (CSharp):
    1.             base
    2.             (
    3.                 VivoxService.Instance.Issuer,
    4.                 string.IsNullOrEmpty(VivoxService.Instance.PlayerId) ? Guid.NewGuid().ToString() : VivoxService.Instance.PlayerId,
    5.                 VivoxService.Instance.Domain,
    6.                 displayname,
    7.                 spokenLanguages,
    8.                 VivoxService.Instance.EnvironmentId
    9.             )
    you will need to make containing folder writable before change...
     
    MurphyMurph_21 likes this.
  8. smartandwise

    smartandwise

    Joined:
    Jul 18, 2022
    Posts:
    6

    Wow I didn't know I can change to writable. Thank's for the tip!