Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Mediation Initialization Failed On Ios

Discussion in 'Unity Mediation' started by bariskaplan, Aug 29, 2022.

  1. bariskaplan

    bariskaplan

    Joined:
    Oct 15, 2013
    Posts:
    6
    Hello, I have some problems with mediation on ios. When running build on iphone, xcode output shows this "
    Initialization Failed: Unknown:Failed to sort tree! It is likely there is a missing required dependency:"

    How to handle this problem? There is no any info about this.

    Full log:
    Code (CSharp):
    1. Initializing...
    2. <Start>d__3:MoveNext()
    3. System.Runtime.CompilerServices.AsyncVoidMethodBuilder:Start(TStateMachine&)
    4. M_Rewarded:Start()
    5.  
    6. Initialization Failed: Unknown:Failed to sort tree! It is likely there is a missing required dependency:
    7. {
    8.   "ordered": [
    9.     {
    10.       "packageHash": 265526080,
    11.       "packageProvider": "CorePackageInitializer",
    12.       "packageDependencies": []
    13.     },
    14.     {
    15.       "packageHash": 220961824,
    16.       "packageProvider": "MediationServiceInitializer",
    17.       "packageDependencies": [
    18.         {
    19.           "dependencyHash": 265726432,
    20.           "dependencyComponent": "IInstallationId",
    21.           "dependencyProvided": "true",
    22.           "dependencyOptional": "false"
    23.         },
    24.         {
    25.           "dependencyHash": 199317712,
    26.           "dependencyComponent": "IProjectConfiguration",
    27.           "dependencyProvided": "true",
    28.           "dependencyOptional": "false"
    29.         }
    30.       ]
    31.     }
    32.   ],
    33.   "packages": [
    34.     {
    35.       "packageHash": 220961824,
    36.       "packageProvider": "MediationServiceInitializer",
    37.       "packageDependencies": [
    38.         {
    39.           "dependencyHash": 265726432,
    40.           "dependencyComponent": "IInstallationId",
    41.           "dependencyProvided": "true",
    42.           "dependencyOptional": "false"
    43.         },
    44.         {
    45.           "dependencyHash": 199317712,
    46.           "dependencyComponent": "IProjectConfiguration",
    47.           "dependencyProvided": "true",
    48.           "dependencyOptional": "false"
    49.         }
    50.       ]
    51.     },
    52.     {
    53.       "packageHash": 220887792,
    54.       "packageProvider": "Ua2CoreInitializeCallback",
    55.       "packageDependencies": [
    56.         {
    57.           "dependencyHash": 265726432,
    58.           "dependencyComponent": "IInstallationId",
    59.           "dependencyProvided": "true",
    60.           "dependencyOptional": "false"
    61.         },
    62.         {
    63.           "dependencyHash": 221218192,
    64.           "dependencyComponent": "IEnvironments",
    65.           "dependencyProvided": "true",
    66.           "dependencyOptional": "false"
    67.         },
    68.         {
    69.           "dependencyHash": 199317712,
    70.           "dependencyComponent": "IProjectConfiguration",
    71.           "dependencyProvided": "true",
    72.           "dependencyOptional": "false"
    73.         },
    74.         {
    75.           "dependencyHash": 266190160,
    76.           "dependencyComponent": "IPlayerId",
    77.           "dependencyProvided": "false",
    78.           "dependencyOptional": "false"
    79.         }
    80.       ]
    81.     },
    82.     {
    83.       "packageHash": 265526080,
    84.       "packageProvider": "CorePackageInitializer",
    85.       "packageDependencies": []
    86.     },
    87.     {
    88.       "packageHash": 265320352,
    89.       "packageProvider": "CorePackageInitializer",
    90.       "packageDependencies": [
    91.         {
    92.           "dependencyHash": 199317712,
    93.           "dependencyComponent": "IProjectConfiguration",
    94.           "dependencyProvided": "true",
    95.           "dependencyOptional": "false"
    96.         },
    97.         {
    98.           "dependencyHash": 265726432,
    99.           "dependencyComponent": "IInstallationId",
    100.           "dependencyProvided": "true",
    101.           "dependencyOptional": "false"
    102.         },
    103.         {
    104.           "dependencyHash": 200053392,
    105.           "dependencyComponent": "IAccessToken",
    106.           "dependencyProvided": "false",
    107.           "dependencyOptional": "false"
    108.         },
    109.         {
    110.           "dependencyHash": 266190160,
    111.           "dependencyComponent": "IPlayerId",
    112.           "dependencyProvided": "false",
    113.           "dependencyOptional": "false"
    114.         }
    115.       ]
    116.     },
    117.     {
    118.       "packageHash": 265602176,
    119.       "packageProvider": "IapCoreInitializeCallback",
    120.       "packageDependencies": [
    121.         {
    122.           "dependencyHash": 220869920,
    123.           "dependencyComponent": "IMetricsFactory",
    124.           "dependencyProvided": "true",
    125.           "dependencyOptional": "false"
    126.         },
    127.         {
    128.           "dependencyHash": 220905056,
    129.           "dependencyComponent": "IDiagnosticsFactory",
    130.           "dependencyProvided": "true",
    131.           "dependencyOptional": "false"
    132.         }
    133.       ]
    134.     }
    135.   ],
    136.   "components": [
    137.     {
    138.       "componentHash": 265726432,
    139.       "component": "IInstallationId",
    140.       "componentPackageHash": 265526080,
    141.       "componentPackage": "CorePackageInitializer"
    142.     },
    143.     {
    144.       "componentHash": 199317712,
    145.       "component": "IProjectConfiguration",
    146.       "componentPackageHash": 265526080,
    147.       "componentPackage": "CorePackageInitializer"
    148.     },
    149.     {
    150.       "componentHash": 221218192,
    151.       "component": "IEnvironments",
    152.       "componentPackageHash": 265526080,
    153.       "componentPackage": "CorePackageInitializer"
    154.     },
    155.     {
    156.       "componentHash": 266190160,
    157.       "component": "IPlayerId",
    158.       "componentPackageHash": 0,
    159.       "componentPackage": "null"
    160.     },
    161.     {
    162.       "componentHash": 200053392,
    163.       "component": "IAccessToken",
    164.       "componentPackageHash": 0,
    165.       "componentPackage": "null"
    166.     },
    167.     {
    168.       "componentHash": 220869920,
    169.       "component": "IMetricsFactory",
    170.       "componentPackageHash": 265526080,
    171.       "componentPackage": "CorePackageInitializer"
    172.     },
    173.     {
    174.       "componentHash": 220905056,
    175.       "component": "IDiagnosticsFactory",
    176.       "componentPackageHash": 265526080,
    177.       "componentPackage": "CorePackageInitializer"
    178.     }
    179.   ]
    180. }
    181. Error: Component with hash[266190160] threw exception when sorting package[220887792][Ua2CoreInitializeCallback]
    182. M_Rewarded:InitializationFailed(Exception)
    183. <Start>d__3:MoveNext()
    184. System.Runtime.CompilerServices.AsyncVoidMethodBuilder:Start(TStateMachine&)
    185. M_Rewarded:Start()
    186.  
    Here is my podfile:
    Code (CSharp):
    1. source 'https://cdn.cocoapods.org/'
    2. platform :ios, '12.0'
    3.  
    4. target 'UnityFramework' do
    5.   pod 'Protobuf'
    6.   pod 'UnityMediationAdmobAdapter', :source => 'https://github.com/Unity-Technologies/unity-mediation-cocoapods-prod.git'
    7.   pod 'UnityMediationAppLovinAdapter', :source => 'https://github.com/Unity-Technologies/unity-mediation-cocoapods-prod.git'
    8.   pod 'UnityMediationSdk', '~> 0.5.0', :source => 'https://github.com/Unity-Technologies/unity-mediation-cocoapods-prod.git'
    9.   pod 'UnityMediationUnityAdapter', :source => 'https://github.com/Unity-Technologies/unity-mediation-cocoapods-prod.git'
    10. end
    11. target 'Unity-iPhone' do
    12. end
    13.  
    14.  
    15.  
    16. use_frameworks!
    17.  
    18. post_install do |installer|
    19.   applicationTargets = [
    20.     'Pods-Unity-iPhone',
    21.   ]
    22.   libraryTargets = [
    23.     'Pods-UnityFramework',
    24.   ]
    25.  
    26.   embedded_targets = installer.aggregate_targets.select { |aggregate_target|
    27.     libraryTargets.include? aggregate_target.name
    28.   }
    29.   embedded_pod_targets = embedded_targets.flat_map { |embedded_target| embedded_target.pod_targets }
    30.   host_targets = installer.aggregate_targets.select { |aggregate_target|
    31.     applicationTargets.include? aggregate_target.name
    32.   }
    33.  
    34.   host_targets.each do |host_target|
    35.     host_target.xcconfigs.each do |config_name, config_file|
    36.       host_target.pod_targets.each do |pod_target|
    37.         if embedded_pod_targets.include? pod_target
    38.           pod_target.specs.each do |spec|
    39.             if spec.attributes_hash['ios'] != nil
    40.               frameworkPaths = spec.attributes_hash['ios']['vendored_frameworks']
    41.             else
    42.               frameworkPaths = spec.attributes_hash['vendored_frameworks']
    43.             end
    44.             if frameworkPaths != nil
    45.               frameworkNames = Array(frameworkPaths).map(&:to_s).map do |filename|
    46.                 extension = File.extname filename
    47.                 File.basename filename, extension
    48.               end
    49.               frameworkNames.each do |name|
    50.                 puts "Removing #{name} from OTHER_LDFLAGS of target #{host_target.name}"
    51.                 config_file.frameworks.delete(name)
    52.               end
    53.             end
    54.           end
    55.         end
    56.       end
    57.       xcconfig_path = host_target.xcconfig_path(config_name)
    58.       config_file.save_as(xcconfig_path)
    59.     end
    60.   end
    61. end
    62.  
    Code (CSharp):
    1. PODS:
    2.   - AppLovinSDK (11.4.3)
    3.   - Google-Mobile-Ads-SDK (9.9.0):
    4.     - GoogleAppMeasurement (< 10.0, >= 7.0)
    5.     - GoogleUserMessagingPlatform (>= 1.1)
    6.   - GoogleAppMeasurement (9.5.0):
    7.     - GoogleAppMeasurement/AdIdSupport (= 9.5.0)
    8.     - GoogleUtilities/AppDelegateSwizzler (~> 7.7)
    9.     - GoogleUtilities/MethodSwizzler (~> 7.7)
    10.     - GoogleUtilities/Network (~> 7.7)
    11.     - "GoogleUtilities/NSData+zlib (~> 7.7)"
    12.     - nanopb (< 2.30910.0, >= 2.30908.0)
    13.   - GoogleAppMeasurement/AdIdSupport (9.5.0):
    14.     - GoogleAppMeasurement/WithoutAdIdSupport (= 9.5.0)
    15.     - GoogleUtilities/AppDelegateSwizzler (~> 7.7)
    16.     - GoogleUtilities/MethodSwizzler (~> 7.7)
    17.     - GoogleUtilities/Network (~> 7.7)
    18.     - "GoogleUtilities/NSData+zlib (~> 7.7)"
    19.     - nanopb (< 2.30910.0, >= 2.30908.0)
    20.   - GoogleAppMeasurement/WithoutAdIdSupport (9.5.0):
    21.     - GoogleUtilities/AppDelegateSwizzler (~> 7.7)
    22.     - GoogleUtilities/MethodSwizzler (~> 7.7)
    23.     - GoogleUtilities/Network (~> 7.7)
    24.     - "GoogleUtilities/NSData+zlib (~> 7.7)"
    25.     - nanopb (< 2.30910.0, >= 2.30908.0)
    26.   - GoogleUserMessagingPlatform (2.0.0)
    27.   - GoogleUtilities/AppDelegateSwizzler (7.7.0):
    28.     - GoogleUtilities/Environment
    29.     - GoogleUtilities/Logger
    30.     - GoogleUtilities/Network
    31.   - GoogleUtilities/Environment (7.7.0):
    32.     - PromisesObjC (< 3.0, >= 1.2)
    33.   - GoogleUtilities/Logger (7.7.0):
    34.     - GoogleUtilities/Environment
    35.   - GoogleUtilities/MethodSwizzler (7.7.0):
    36.     - GoogleUtilities/Logger
    37.   - GoogleUtilities/Network (7.7.0):
    38.     - GoogleUtilities/Logger
    39.     - "GoogleUtilities/NSData+zlib"
    40.     - GoogleUtilities/Reachability
    41.   - "GoogleUtilities/NSData+zlib (7.7.0)"
    42.   - GoogleUtilities/Reachability (7.7.0):
    43.     - GoogleUtilities/Logger
    44.   - nanopb (2.30909.0):
    45.     - nanopb/decode (= 2.30909.0)
    46.     - nanopb/encode (= 2.30909.0)
    47.   - nanopb/decode (2.30909.0)
    48.   - nanopb/encode (2.30909.0)
    49.   - PromisesObjC (2.1.1)
    50.   - Protobuf (3.12.0)
    51.   - UnityAds (4.3.0)
    52.   - UnityMediationAdapter (3.0.1):
    53.     - UnityMediationLogging (~> 1.0)
    54.   - UnityMediationAdmobAdapter (1.0.0):
    55.     - Google-Mobile-Ads-SDK (~> 9.0)
    56.     - UnityMediationAdapter (~> 3.0)
    57.     - UnityMediationSdk (>= 0.5)
    58.   - UnityMediationAppLovinAdapter (1.0.0):
    59.     - AppLovinSDK (~> 11.0)
    60.     - UnityMediationAdapter (~> 3.0)
    61.     - UnityMediationSdk (>= 0.5)
    62.   - UnityMediationLogging (1.0.0)
    63.   - UnityMediationSdk (0.5.1):
    64.     - Protobuf (~> 3.12.0)
    65.     - UnityMediationAdapter (~> 3.0)
    66.     - UnityMediationLogging (~> 1.0)
    67.   - UnityMediationUnityAdapter (1.0.0):
    68.     - UnityAds (~> 4.1)
    69.     - UnityMediationAdapter (~> 3.0)
    70.     - UnityMediationSdk (>= 0.5)
    71.  
    72. DEPENDENCIES:
    73.   - Protobuf
    74.   - UnityMediationAdmobAdapter
    75.   - UnityMediationAppLovinAdapter
    76.   - UnityMediationSdk (~> 0.5.0)
    77.   - UnityMediationUnityAdapter
    78.  
    79. SPEC REPOS:
    80.   https://github.com/Unity-Technologies/unity-mediation-cocoapods-prod.git:
    81.     - UnityMediationAdapter
    82.     - UnityMediationAdmobAdapter
    83.     - UnityMediationAppLovinAdapter
    84.     - UnityMediationLogging
    85.     - UnityMediationSdk
    86.     - UnityMediationUnityAdapter
    87.   trunk:
    88.     - AppLovinSDK
    89.     - Google-Mobile-Ads-SDK
    90.     - GoogleAppMeasurement
    91.     - GoogleUserMessagingPlatform
    92.     - GoogleUtilities
    93.     - nanopb
    94.     - PromisesObjC
    95.     - Protobuf
    96.     - UnityAds
    97.  
    98. SPEC CHECKSUMS:
    99.   AppLovinSDK: 221dfbdff620be0ff227ed5b018b97b1f3d15713
    100.   Google-Mobile-Ads-SDK: 8822993da940ab920bad131b5bffce7eb3f62c6a
    101.   GoogleAppMeasurement: 6ee231473fbd75c11221dfce489894334024eead
    102.   GoogleUserMessagingPlatform: ab890ce5f6620f293a21b6bdd82e416a2c73aeca
    103.   GoogleUtilities: e0913149f6b0625b553d70dae12b49fc62914fd1
    104.   nanopb: b552cce312b6c8484180ef47159bc0f65a1f0431
    105.   PromisesObjC: ab77feca74fa2823e7af4249b8326368e61014cb
    106.   Protobuf: 2793fcd0622a00b546c60e7cbbcc493e043e9bb9
    107.   UnityAds: 53f7a71da8a16b3eedb57d3930e672687939f643
    108.   UnityMediationAdapter: ea2a9f5510b4991ef981ea53469d32eeccd400a2
    109.   UnityMediationAdmobAdapter: 28db62b82f399a63acae77c3ab8e969c0561b433
    110.   UnityMediationAppLovinAdapter: a75f8426d06c71ded269e26ae31a8ca966d2df73
    111.   UnityMediationLogging: af0274f8b544950228abd302e793d5f43404b770
    112.   UnityMediationSdk: 44880c02548f05b0026a502440049c71159ce802
    113.   UnityMediationUnityAdapter: 4b0c00cc3d630507d86b8dd2d33517504ecc5f43
    114.  
    115. PODFILE CHECKSUM: 60aa919e392ce2d837afa41147a1dfb0780624b9
    116.  
    117. COCOAPODS: 1.11.3
    118.  

    Thanks in advance
     
  2. Menion-Leah

    Menion-Leah

    Joined:
    Nov 5, 2014
    Posts:
    189
    Maybe this thread can help you: unfortunately it has been closed and it looks like Unity staff didn't investigate further.

    I'm experiencing the same issue mentioned there - it looks like IAP/RemoteConfig/ExceptionReporting work properly nonetheless, despite the error being logged every time.
    I'm not using Unity Ads anymore so I'm not able to tell you if mediation is working properly or not.

    Unity 2020.3.39f1
    RemoteConfig 3.1.3
    IAP 4.4.1
     
  3. jcGrenier

    jcGrenier

    Unity Technologies

    Joined:
    Feb 23, 2021
    Posts:
    145
    Hi @Menion-Leah ,
    This sounds like a problem initializing UGS. could you let us know what version of Services Core you have installed in package manager? There was an issue that was fixed some time ago, 1.4.0+ should definitely have the fix, unless it is a regression.
     
  4. Menion-Leah

    Menion-Leah

    Joined:
    Nov 5, 2014
    Posts:
    189
    Hi @jcGrenier !

    Sorry, I can't find any Services Core in the package manager.
    This is the list of the currently installed packages:

     
  5. jcGrenier

    jcGrenier

    Unity Technologies

    Joined:
    Feb 23, 2021
    Posts:
    145
    It seems like Mediation is not installed either.
    Unfortunately I do not know for sure which package includes Core Services, or what version of it.
    You can try going to package manager and clicking the little + at the top left, select add package by name, and add com.unity.services.core This should allow you to update to the latest services core package. If the issue persist I would recommend asking in the forum section related to the package you are trying to use. At a quick glance I would say it is likely the Analytics Library.
     
  6. Menion-Leah

    Menion-Leah

    Joined:
    Nov 5, 2014
    Posts:
    189
    Thanks for the suggestions, @jcGrenier

    Upon investigation, it looks like my current setup involves:

    Using Services Core 1.4.0:
    • Analytics 4.0.1
    • Remote Config Runtime 3.1.3

    Using Services Core 1.3.1 (1.4.0 installed):

    • Authentication 2.0.0
    • In App Purchasing 4.4.1 (latest verified version)

    It looks like the initial assumption, mentioned in the closed thread I linked, was right: the problem lies in the In App Purchasing 4.4.1 release.
    Unfortunately it's the last one labeled as Verified, so updating it to a more recent version is not an option for us.
     
  7. Menion-Leah

    Menion-Leah

    Joined:
    Nov 5, 2014
    Posts:
    189
    Furthermore, even updating to the latest In App Purchasing package version, it will still rely on the outdated Services Core package.


     
  8. jcGrenier

    jcGrenier

    Unity Technologies

    Joined:
    Feb 23, 2021
    Posts:
    145
    If I am not mistaken, if you have several dependencies on the same package, the highest version will be used. so here you see IAP depends on 1.3.1, but you have 1.4.0 installed, which should be good.
    If I remember correctly Unity Mediation depends on core 1.4.0, and the issue you mentioned was resolved, so I would assume having 1.4.0 would resolve your issue?

    If not please submit a log and I will pass it along to the services core team for further investigation.
     
  9. Menion-Leah

    Menion-Leah

    Joined:
    Nov 5, 2014
    Posts:
    189
    Thank you for your support, @jcGrenier !

    When running the game on a test device in order to collect related logs, I noticed the error disappeared.
    The only relevant change since the last version affected by the issue was to remove the com.unity.ads package, version 3.7.5.
    Hope that helps!
     
    jcGrenier likes this.