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

Bug Unity Gaming Service DependencyTreeComponentHashException

Discussion in 'Unity IAP' started by lavrkitplay, Mar 14, 2023.

  1. lavrkitplay

    lavrkitplay

    Joined:
    Apr 25, 2022
    Posts:
    2
    Hi, I builded my project to local testing in google play and faced with Inisialising UnityServices Problem. I founded same problem in form, but that one was solved by changing remote config verision and I can't do it. The error is probably caused by authorization and RemoteConfig.

    Remote config version: 3.2.2

    Part of my code:
    var options = new InitializationOptions();
    options.SetAnalyticsUserId(FirebaseAuth.DefaultInstance.CurrentUser.UserId);
    await UnityServices.InitializeAsync(options);


    Error in console:
    DependencyTreeComponentHashException: Exception of type 'Unity.Services.Core.Internal.DependencyTreeComponentHashException' was thrown.
    Unity.Services.Core.Internal.DependencyTreeInitializeOrderSorter.GetPackageTypeHashFor (System.Int32 componentTypeHash) (at <00000000000000000000000000000000>:0)
    Unity.Services.Core.Internal.DependencyTreeInitializeOrderSorter.SortTreeThrough (System.Collections.Generic.IEnumerable1[T] dependencyTypeHashes) (at <00000000000000000000000000000000>:0)
    Unity.Services.Core.Internal.DependencyTreeInitializeOrderSorter.SortTreeThrough (System.Int32 packageTypeHash) (at <00000000000000000000000000000000>:0)
    Unity.Services.Core.Internal.DependencyTreeInitializeOrderSorter.SortRegisteredPackagesIntoTarget () (at <00000000000000000000000000000000>:0)
    Unity.Services.Core.Internal.UnityServicesInternal.InitializeServicesAsync () (at <00000000000000000000000000000000>:0)
    System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine] (TStateMachine& stateMachine) (at <00000000000000000000000000000000>:0)
    Unity.Services.Core.Internal.UnityServicesInternal.InitializeServicesAsync () (at <00000000000000000000000000000000>:0)
    Unity.Services.Core.Internal.UnityServicesInternal.InitializeAsync (Unity.Services.Core.InitializationOptions options) (at <00000000000000000000000000000000>:0)
    System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine] (TStateMachine& stateMachine) (at <00000000000000000000000000000000>:0)
    Unity.Services.Core.Internal.UnityServicesInternal.InitializeAsync (Unity.Services.Core.InitializationOptions options) (at <00000000000000000000000000000000>:0)
    Unity.Services.Core.UnityServices.InitializeAsync (Unity.Services.Core.InitializationOptions options) (at <00000000000000000000000000000000>:0)
    System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine] (TStateMachine& stateMachine) (at <00000000000000000000000000000000>:0)
    Unity.Services.Core.UnityServices.InitializeAsync (Unity.Services.Core.InitializationOptions options) (at <00000000000000000000000000000000>:0)
    Core.Loading.OperationsLoading.ConnectClientOperation.Load (System.Action1[T] onProgress) (at <00000000000000000000000000000000>:0)
    System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine] (TStateMachine& stateMachine) (at <00000000000000000000000000000000>:0)
    Core.Loading.OperationsLoading.ConnectClientOperation.Load (System.Action1[T] onProgress) (at <00000000000000000000000000000000>:0)
    Core.Loading.OperationsLoading.LoadingScreen.Load (System.Collections.Generic.Queue1[T] loadingOperations) (at <00000000000000000000000000000000>:0)
    System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine] (TStateMachine& stateMachine) (at <00000000000000000000000000000000>:0)
    Core.Loading.OperationsLoading.LoadingScreen.Load (System.Collections.Generic.Queue1[T] loadingOperations) (at <00000000000000000000000000000000>:0)
    Core.Loading.AssetsLoading.Providers.LoadingScreenProvider.LoadAndDestroy (System.Collections.Generic.Queue1[T] loadingOperations) (at <00000000000000000000000000000000>:0)
    System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) (at <00000000000000000000000000000000>:0)
    System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run () (at <00000000000000000000000000000000>:0)
    System.Threading.Tasks.AwaitTaskContinuation.RunCallback (System.Threading.ContextCallback callback, System.Object state, System.Threading.Tasks.Task& currentTask) (at <00000000000000000000000000000000>:0)
    System.Threading.Tasks.Task.FinishContinuations () (at <00000000000000000000000000000000>:0)
    System.Threading.Tasks.Task`1[TResult].TrySetResult (TResult result) (at <00000000000000000000000000000000>:0)

    Всеволод Косарев, [15.03.2023 3:21]
    System.Runtime.CompilerServices.AsyncTaskMethodBuilder1[TResult].SetResult (TResult result) (at <00000000000000000000000000000000>:0)
    Core.Loading.AssetsLoading.LocalAssetsLoader1[T].Load () (at <00000000000000000000000000000000>:0)
    System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) (at <00000000000000000000000000000000>:0)
    System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run () (at <00000000000000000000000000000000>:0)
    UnityEngine.UnitySynchronizationContext+WorkRequest.Invoke () (at <00000000000000000000000000000000>:0)
    UnityEngine.UnitySynchronizationContext.Exec () (at <00000000000000000000000000000000>:0)
    Rethrow as DependencyTreePackageHashException: Component with hash[1138372000] threw exception when sorting package[1113215008][Ua2CoreInitializeCallback]
    Unity.Services.Core.Internal.DependencyTreeInitializeOrderSorter.SortTreeThrough (System.Int32 packageTypeHash) (at <00000000000000000000000000000000>:0)
    Unity.Services.Core.Internal.DependencyTreeInitializeOrderSorter.SortRegisteredPackagesIntoTarget () (at <00000000000000000000000000000000>:0)
    Unity.Services.Core.Internal.UnityServicesInternal.InitializeServicesAsync () (at <00000000000000000000000000000000>:0)
    System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine] (TStateMachine& stateMachine) (at <00000000000000000000000000000000>:0)
    Unity.Services.Core.Internal.UnityServicesInternal.InitializeServicesAsync () (at <00000000000000000000000000000000>:0)
    Unity.Services.Core.Internal.UnityServicesInternal.InitializeAsync (Unity.Services.Core.InitializationOptions options) (at <00000000000000000000000000000000>:0)
    System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine] (TStateMachine& stateMachine) (at <00000000000000000000000000000000>:0)
    Unity.Services.Core.Internal.UnityServicesInternal.InitializeAsync (Unity.Services.Core.InitializationOptions options) (at <00000000000000000000000000000000>:0)
    Unity.Services.Core.UnityServices.InitializeAsync (Unity.Services.Core.InitializationOptions options) (at <00000000000000000000000000000000>:0)
    System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine] (TStateMachine& stateMachine) (at <00000000000000000000000000000000>:0)
    Unity.Services.Core.UnityServices.InitializeAsync (Unity.Services.Core.InitializationOptions options) (at <00000000000000000000000000000000>:0)
    Core.Loading.OperationsLoading.ConnectClientOperation.Load (System.Action1[T] onProgress) (at <00000000000000000000000000000000>:0)
    System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine] (TStateMachine& stateMachine) (at <00000000000000000000000000000000>:0)
    Core.Loading.OperationsLoading.ConnectClientOperation.Load (System.Action1[T] onProgress) (at <00000000000000000000000000000000>:0)
    Core.Loading.OperationsLoading.LoadingScreen.Load (System.Collections.Generic.Queue1[T] loadingOperations) (at <00000000000000000000000000000000>:0)
    System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine] (TStateMachine& stateMachine) (at <00000000000000000000000000000000>:0)
    Core.Loading.OperationsLoading.LoadingScreen.Load (System.Collections.Generic.Queue1[T] loadingOperations) (at <00000000000000000000000000000000>:0)
    Core.Loading.AssetsLoading.Providers.LoadingScreenProvider.LoadAndDestroy (System.Collections.Generic.Queue`1[T] loadingOperations) (at <00000000000000000000000000000000>:0)
    System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) (at <00000000000000000000000000000000>:0)
    Всеволод Косарев, [15.03.2023 3:21]
    System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run () (at <00000000000000000000000000000000>:0)
    System.Threading.Tasks.AwaitTaskContinuation.RunCallback (System.Threading.ContextCallback callback, System.Object state, System.Threading.Tasks.Task& currentTask) (at <00000000000000000000000000000000>:0)
    System.Threading.Tasks.Task.FinishContinuations () (at <00000000000000000000000000000000>:0)
    System.Threading.Tasks.Task1[TResult].TrySetResult (TResult result) (at <00000000000000000000000000000000>:0)
    System.Runtime.CompilerServices.AsyncTaskMethodBuilder1[TResult].SetResult (TResult result) (at <00000000000000000000000000000000>:0)
    Core.Loading.AssetsLoading.LocalAssetsLoader`1[T].Load () (at <00000000000000000000000000000000>:0)
    System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) (at <00000000000000000000000000000000>:0)
    System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run () (at <00000000000000000000000000000000>:0)
    UnityEngine.UnitySynchronizationContext+WorkRequest.Invoke () (at <00000000000000000000000000000000>:0)
    UnityEngine.UnitySynchronizationContext.Exec () (at <00000000000000000000000000000000>:0)
    Rethrow as DependencyTreeSortFailedException: Failed to sort tree! It is likely there is a missing required dependency:
    {
    "ordered": [
    {
    "packageHash": 1113407264,
    "packageProvider": "CorePackageInitializer",
    "packageDependencies": []
    }
    ],
    "packages": [
    {
    "packageHash": 1113215008,
    "packageProvider": "Ua2CoreInitializeCallback",
    "packageDependencies": [
    {
    "dependencyHash": 1150912288,
    "dependencyComponent": "IInstallationId",
    "dependencyProvided": "true",
    "dependencyOptional": "false"
    },
    {
    "dependencyHash": 1112806944,
    "dependencyComponent": "ICloudProjectId",
    "dependencyProvided": "true",
    "dependencyOptional": "false"
    },
    {
    "dependencyHash": 1138611040,
    "dependencyComponent": "IEnvironments",
    "dependencyProvided": "true",
    "dependencyOptional": "false"
    },
    {
    "dependencyHash": 1137783264,
    "dependencyComponent": "IProjectConfiguration",
    "dependencyProvided": "true",
    "dependencyOptional": "false"
    },
    {
    "dependencyHash": 1138372000,
    "dependencyComponent": "IPlayerId",
    "dependencyPro<truncated>
     
  2. Yannick_D

    Yannick_D

    Unity Technologies

    Joined:
    Feb 21, 2022
    Posts:
    218
    Hello lavrkitplay,

    We had other users reporting this same error and it was solved by calling the remote config fetch after UGS initialization is completed.

    Could you try this to see if it works for you too?
     
    SebT_Unity likes this.
  3. lavrkitplay

    lavrkitplay

    Joined:
    Apr 25, 2022
    Posts:
    2
    Yes, it helped me. Thank you very much!
     
    SebT_Unity likes this.