Search Unity

Resolved Vivox error: Something is wrong: either a project is not linked, or Authentication was not..

Discussion in 'Vivox (Voice & Text Chat)' started by Jon-the-Creator, Mar 28, 2023.

  1. Jon-the-Creator

    Jon-the-Creator

    Joined:
    Jul 23, 2021
    Posts:
    9
    Hi Guys,

    Just randomly Vivox has started throwing up the following three errors:

    Code (CSharp):
    1. [Vivox]: Something is wrong: either a project is not linked, or Authentication was not signed into before calling VivoxService.Instance.Initialize(). Please ensure that a project is properly linked at "Edit > Project Settings > Services > Vivox"
    2. UnityEngine.Debug:LogError (object)
    3. Unity.Services.Vivox.VivoxServiceInternal:Initialize (VivoxUnity.VivoxConfig) (at Packages/com.unity.services.vivox@7fe460fb46ad/Runtime/VivoxServiceInternal.cs:91)
    4. VivoxManager/<Start>d__33:MoveNext () (at Assets/_Project/Scripts/Managers/VivoxManager.cs:112)
    5. System.Runtime.CompilerServices.AsyncVoidMethodBuilder:Start<VivoxManager/<Start>d__33> (VivoxManager/<Start>d__33&)
    6. VivoxManager:Start ()
    Code (CSharp):
    1. GetToken: Unable to generate local Vivox Access Tokens because a Vivox Key has not been provided.
    2. UnityEngine.Debug:LogError (object)
    3. VivoxUnity.VivoxDebug:DebugMessage (object,vx_log_level) (at Packages/com.unity.services.vivox@7fe460fb46ad/Runtime/VivoxUnity/VivoxDebug.cs:87)
    4. VivoxUnity.VivoxDebug:VxExceptionMessage (string) (at Packages/com.unity.services.vivox@7fe460fb46ad/Runtime/VivoxUnity/VivoxDebug.cs:45)
    5. VivoxUnity.VxTokenGen:GetToken (string,System.Nullable`1<System.TimeSpan>,string,string,string,string,string) (at Packages/com.unity.services.vivox@7fe460fb46ad/Runtime/VivoxUnity/VxTokenGen.cs:71)
    6. VivoxUnity.VxTokenGen:GetLoginToken (string,System.Nullable`1<System.TimeSpan>) (at Packages/com.unity.services.vivox@7fe460fb46ad/Runtime/VivoxUnity/VxTokenGen.cs:20)
    7. VivoxUnity.Private.LoginSession:GetLoginToken (System.Nullable`1<System.TimeSpan>) (at Packages/com.unity.services.vivox@7fe460fb46ad/Runtime/VivoxUnity/Private/LoginSession.cs:466)
    8. VivoxManager:Login (string) (at Assets/_Project/Scripts/Managers/VivoxManager.cs:261)
    9. VivoxManager/<Start>d__33:MoveNext () (at Assets/_Project/Scripts/Managers/VivoxManager.cs:118)
    10. System.Runtime.CompilerServices.AsyncVoidMethodBuilder:Start<VivoxManager/<Start>d__33> (VivoxManager/<Start>d__33&)
    11. VivoxManager:Start ()
    12.  
    Code (CSharp):
    1. ArgumentNullException: Value cannot be null.
    2. Parameter name: accessToken
    3. VivoxUnity.Private.LoginSession.BeginLogin (System.Uri server, System.String accessToken, VivoxUnity.SubscriptionMode subscriptionMode, VivoxUnity.IReadOnlyHashSet`1[T] presenceSubscriptions, VivoxUnity.IReadOnlyHashSet`1[T] blockedPresenceSubscriptions, VivoxUnity.IReadOnlyHashSet`1[T] allowedPresenceSubscriptions, System.Boolean uriServerRequired, System.Boolean presenceDesired, System.AsyncCallback callback) (at Packages/com.unity.services.vivox@7fe460fb46ad/Runtime/VivoxUnity/Private/LoginSession.cs:455)
    4. VivoxUnity.Private.LoginSession.BeginLogin (System.String accessToken, VivoxUnity.SubscriptionMode subscriptionMode, VivoxUnity.IReadOnlyHashSet`1[T] presenceSubscriptions, VivoxUnity.IReadOnlyHashSet`1[T] blockedPresenceSubscriptions, VivoxUnity.IReadOnlyHashSet`1[T] allowedPresenceSubscriptions, System.AsyncCallback callback) (at Packages/com.unity.services.vivox@7fe460fb46ad/Runtime/VivoxUnity/Private/LoginSession.cs:381)
    5. VivoxManager.Login (System.String displayName) (at Assets/_Project/Scripts/Managers/VivoxManager.cs:261)
    6. VivoxManager.Start () (at Assets/_Project/Scripts/Managers/VivoxManager.cs:118)
    7. System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__7_0 (System.Object state) (at <03bd9b261dff4c2b8b568aca27f561b2>:0)
    8. UnityEngine.UnitySynchronizationContext+WorkRequest.Invoke () (at <e8a406da998549af9a2680936c7da25a>:0)
    9. UnityEngine.UnitySynchronizationContext.Exec () (at <e8a406da998549af9a2680936c7da25a>:0)
    10. UnityEngine.UnitySynchronizationContext.ExecuteTasks () (at <e8a406da998549af9a2680936c7da25a>:0)
    11.  

    I've tried linking and unlinking the project but this does not fix the issue. Vivox is initialized as follows

    Code (CSharp):
    1.     async void Start()
    2.     {
    3.         if (UnityServices.State != ServicesInitializationState.Initialized)
    4.         {
    5.             await UnityServices.InitializeAsync();
    6.             await AuthenticationService.Instance.SignInAnonymouslyAsync();
    7.  
    8.         }
    9.  
    10.         if (!loggedIn)
    11.         {
    12.             VivoxService.Instance.Initialize();
    13.  
    14.             client = VivoxService.Instance.Client;
    15.             client.AudioInputDevices.Muted = true;
    16.             IsInitialized = true;
    17.  
    18.             Login();
    19.         }
    20.     }
    Code (CSharp):
    1.     public void Login(string displayName = null)
    2.     {
    3.         Debug.Log("displayName: " + displayName);
    4.         var account = new Account(displayName);
    5.         Debug.Log("account: " + account.IsEmpty);
    6.  
    7.         loginSession = client.GetLoginSession(account);
    8.         loginSession.PropertyChanged += OnLoginSessionPropertyChanged;
    9.  
    10.         loginSession.BeginLogin(loginSession.GetLoginToken(), SubscriptionMode.Accept, null, null, null, ar =>
    11.         {
    12.             try
    13.             {
    14.                 loginSession.EndLogin(ar);
    15.             }
    16.             catch (Exception e)
    17.             {
    18.                 // Unbind any login session-related events you might be subscribed to.
    19.                 // Handle error
    20.                 return;
    21.             }
    22.             // At this point, we have successfully requested to login.
    23.             // When you are able to join channels, LoginSession.State will be set to LoginState.LoggedIn.
    24.             // Reference LoginSession_PropertyChanged()
    25.         });
    26.     }
    27.  
    Any idea what could be wrong?

    Thanks
     
  2. Jon-the-Creator

    Jon-the-Creator

    Joined:
    Jul 23, 2021
    Posts:
    9
    This was caused by another plugin re initializing the unity services
     
    MurphyMurph_21 and grempire like this.