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. Voting for the Unity Awards are OPEN! We’re looking to celebrate creators across games, industry, film, and many more categories. Cast your vote now for all categories
    Dismiss Notice
  3. Dismiss Notice

Not compatible with multi-scene setup [0.1.2]

Discussion in 'Addressables' started by xVergilx, Jun 25, 2018.

  1. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    3,292
    I'm unable to run the asset completely, in the multi-scene setup. This is on Fast / Virtual.
    When I just press play I get following error:
    Code (CSharp):
    1. ArgumentException: An element with the same key already exists in the dictionary.
    2. System.Collections.Generic.Dictionary`2[System.Object,UnityEngine.AddressableAssets.ContentCatalogData+DataEntry].Add (System.Object key, UnityEngine.AddressableAssets.DataEntry value) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:404)
    3. UnityEditor.AddressableAssets.BuildScript.PrepareRuntimeData (Boolean isPlayerBuild, Boolean isDevBuild, Boolean allowProfilerEvents, Boolean forceRebuild, Boolean enteringPlayMode, BuildTargetGroup buildTargetGroup, BuildTarget buildTarget) (at C:/Users/Vergil/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.addressables@0.1.2-preview/Editor/Build/BuildScript.cs:236)
    4. UnityEditor.AddressableAssets.BuildScript.OnEditorPlayModeChanged (PlayModeStateChange state) (at C:/Users/Vergil/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.addressables@0.1.2-preview/Editor/Build/BuildScript.cs:54)
    5. UnityEditor.EditorApplication.Internal_PlayModeStateChanged (PlayModeStateChange state) (at C:/buildslave/unity/build/Editor/Mono/EditorApplication.cs:293)
    6. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
    7.  
    Followed by:
    Code (CSharp):
    1. Exception: Unable to load runtime data.
    2. UnityEngine.AddressableAssets.InitializationOperation.OnDataLoaded (IAsyncOperation`1 op) (at C:/Users/Vergil/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.addressables@0.1.2-preview/Runtime/InitializationOperation.cs:29)
    3. UnityEngine.ResourceManagement.AsyncOperationBase`1[UnityEngine.AddressableAssets.ResourceManagerRuntimeData].InvokeCompletionEvent () (at C:/Users/Vergil/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.resourcemanager@2.1.0-preview/Runtime/AsyncOperations/AsyncOperationBase.cs:208)
    4. UnityEngine.AsyncOperation:InvokeCompletionEvent()
    And on:
    Code (CSharp):
    1. Exception thrown in DynamicInvoke: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Exception: Unable to load runtime data.
    2.   at UnityEngine.AddressableAssets.InitializationOperation.OnDataLoaded (IAsyncOperation`1 op) [0x00011] in C:\Users\Vergil\AppData\Local\Unity\cache\packages\packages.unity.com\com.unity.addressables@0.1.2-preview\Runtime\InitializationOperation.cs:29
    3.   at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)
    4.   at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x000d0] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222
    5.   --- End of inner exception stack trace ---
    6.   at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x000eb] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232
    7.   at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115
    8.   at System.Delegate.DynamicInvokeImpl (System.Object[] args) [0x000b9] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System/Delegate.cs:443
    9.   at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) [0x00018] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System/MulticastDelegate.cs:71
    10.   at System.Delegate.DynamicInvoke (System.Object[] args) [0x00000] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System/Delegate.cs:415
    11.   at UnityEngine.ResourceManagement.DelayedActionManager+DelegateInfo.Invoke () [0x0000e] in C:\Users\Vergil\AppData\Local\Unity\cache\packages\packages.unity.com\com.unity.resourcemanager@2.1.0-preview\Runtime\Util\DelayedActionManager.cs:45  0 (target=UnityEngine.AddressableAssets.InitializationOperation result = False, status = None, Valid = True, canRelease = False) InitializationOperation.OnDataLoaded(UnityEngine.ResourceManagement.RawDataProvider+InternalOp`1[UnityEngine.AddressableAssets.ResourceManagerRuntimeData] result = , status = Failed, Valid = True, canRelease = False) @0
    12. UnityEngine.ResourceManagement.DelayedActionManager:LateUpdate()
    @audrey-unity Any ETA on multi-scene support? I'd really like to use Addressables, they're invaluable for my project.
     

    Attached Files:

    Last edited: Jun 25, 2018
  2. PaulBurslem

    PaulBurslem

    Unity Technologies

    Joined:
    Oct 7, 2016
    Posts:
    79
    Do you have multiple asset groups with the same name? From looking at your callstack that would explain the error you are seeing. I'll make a note to add better error handling and warnings in this area as well.
     
  3. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    3,292
    Not really. I've rolled back the changes quite some time ago, but as far as I remember, there was like only one group.
    I haven't changed much in terms of default settings of asset bundling.

    My wild guess on what's going on is that assets have pushed multiple times to the dictionary for some reason when there's multiple scenes loaded.

    Why not just assign values to the keys ignoring checks? Like:
    Dictionary[key] = Value;

    It would update existing keys, and get rid of the errors as well.
    As for the extra checks, they could be performed inside conditional method.
    Warning should be sufficient, unless there's some reason behind not assigning possible duplicates.
     
  4. PaulBurslem

    PaulBurslem

    Unity Technologies

    Joined:
    Oct 7, 2016
    Posts:
    79
    We found an issue with duplicate entries in resources folders that can cause this - the fix will be in the next release (eta early next week).
     
    LaerdalHH likes this.
  5. LaerdalHH

    LaerdalHH

    Joined:
    Nov 14, 2017
    Posts:
    7
    Should it be available now ?

    I'm still on 0.1.2-preview and I have the same exceptions and stacktraces
     
  6. unity_bill

    unity_bill

    Unity Technologies

    Joined:
    Apr 11, 2017
    Posts:
    1,053
    release 0.2.1-preview is now out, that was the one Paul had been referring to. Please try on this release and let us know if there's still any problem.

    Thanks,
    Bill
     
  7. LaerdalHH

    LaerdalHH

    Joined:
    Nov 14, 2017
    Posts:
    7
    Seems to work here