VivoxService.Instance always null

Hi,

As the title mentions when I try and call await VivoxService.Instance.InitializeAsync(); I always get a

NullReferenceException: Object reference not set to an instance of an object

I am using the latest Vivox package 16.5.3. I am trying to initialize it after I have initialized unity services and after I have authenticated.

 await UnityServices.InitializeAsync();

 //Wait to be authenticated
 AuthState authState = await AuthenticationWrapper.DoAuth();

 if (authState == AuthState.Authenticated)
 {
     await VivoxService.Instance.InitializeAsync();
}

Any help would be much appreciated.

Hey, ezraegreen!

Got a few clarifying questions:

  1. Have you had Vivox working at all previously?
  2. Is there any additional info in the callstack?
  3. Do you have a Unity Dashboard project assigned to your editor project? If you do not, this should be setup although it should generally happen automatically for you if the editor/hub is connected to a Unity Dashboard account.
  4. Do you have Vivox credentials? (These can be fetched in the editor from a connected Unity Dashboard project via the top menu, Services > Vivox > Configure, or heading into Project Settings > Services > Vivox

Hi,

  1. I have had Vivox working on a sample project and also on a blank project for testing. However when I try and get it working in my main project I am getting the error I described.

  2. Here is the rest of the stack but it doesnt give any useful info I dont think.

NullReferenceException: Object reference not set to an instance of an object
ClientGameManager.InitAsync () (at Assets/Scripts/Networking/Client/ClientGameManager.cs:56)
ClientSingleton.CreateClient () (at Assets/Scripts/Networking/Client/ClientSingleton.cs:36)
ApplicationController.LaunchInMode (System.Boolean isDedicatedServer) (at Assets/Scripts/Networking/ApplicationController.cs:63)
ApplicationController.Start () (at Assets/Scripts/Networking/ApplicationController.cs:33)
System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__7_0 (System.Object state) (at <c4a10e89722742a4b5cd750857e291eb>:0)
UnityEngine.UnitySynchronizationContext+WorkRequest.Invoke () (at <affe600311164ff58161da271ceee4f0>:0)
UnityEngine.UnitySynchronizationContext.Exec () (at <affe600311164ff58161da271ceee4f0>:0)
UnityEngine.UnitySynchronizationContext.ExecuteTasks () (at <affe600311164ff58161da271ceee4f0>:0)
  1. Yes I have a project assigned. I am using a few other unity services and they are working fine.

  2. Yes I can see credentials in Unity. I they are auto synced to my project unser Services > Vivox.

My thoughts is that it isn`t initialising properly or maybe it is not included in build files or something like that. But I am not sure how to investigate that.

Thanks :slight_smile:

Is this only happening in builds? Also, on which platform is this happening on?