Search Unity

  1. New Unity Live Help updates. Check them out here!

    Dismiss Notice

Null key when building addressables

Discussion in 'Addressables' started by Ghat-Smith, Mar 19, 2020.

  1. Ghat-Smith

    Ghat-Smith

    Joined:
    Aug 16, 2016
    Posts:
    18
    Hi. Since I upgraded package to version 1.7.4 I can't build my addressables (using Build > New Build > Default Build Script). I removed my addressables, it now only contains the Built In Data, the Defaut Local Group (empty) and another empty group I created.

    After downgrading package to version 1.6.2 build is working properly.

    Here is the error I get when trying a build :

    Code (CSharp):
    1. ArgumentNullException: Value cannot be null.
    2. Parameter name: key
    3. System.Collections.Generic.Dictionary`2[TKey,TValue].FindEntry (TKey key) (at <437ba245d8404784b9fbab9b439ac908>:0)
    4. System.Collections.Generic.Dictionary`2[TKey,TValue].TryGetValue (TKey key, TValue& value) (at <437ba245d8404784b9fbab9b439ac908>:0)
    5. UnityEngine.AddressableAssets.ResourceLocators.ContentCatalogData+KeyIndexer`1[T].Add (T key, System.Boolean& isNew) (at Library/PackageCache/com.unity.addressables@1.7.4/Runtime/ResourceLocators/ContentCatalogData.cs:374)
    6. UnityEngine.AddressableAssets.ResourceLocators.ContentCatalogData+KeyIndexer`1[T].Add (System.Collections.Generic.IEnumerable`1[T] keyCollection) (at Library/PackageCache/com.unity.addressables@1.7.4/Runtime/ResourceLocators/ContentCatalogData.cs:368)
    7. UnityEngine.AddressableAssets.ResourceLocators.ContentCatalogData+KeyIndexer`1[T]..ctor (System.Collections.Generic.IEnumerable`1[T] keyCollection, System.Int32 capacity) (at Library/PackageCache/com.unity.addressables@1.7.4/Runtime/ResourceLocators/ContentCatalogData.cs:361)
    8. UnityEngine.AddressableAssets.ResourceLocators.ContentCatalogData.SetData (System.Collections.Generic.IList`1[T] data) (at Library/PackageCache/com.unity.addressables@1.7.4/Runtime/ResourceLocators/ContentCatalogData.cs:426)
    9. UnityEngine.AddressableAssets.ResourceLocators.ContentCatalogData..ctor (System.Collections.Generic.IList`1[T] entries, System.String id) (at Library/PackageCache/com.unity.addressables@1.7.4/Runtime/ResourceLocators/ContentCatalogData.cs:349)
    10. UnityEditor.AddressableAssets.Build.DataBuilders.BuildScriptPackedMode.DoBuild[TResult] (UnityEditor.AddressableAssets.Build.AddressablesDataBuilderInput builderInput, UnityEditor.AddressableAssets.Build.DataBuilders.AddressableAssetsBuildContext aaContext) (at Library/PackageCache/com.unity.addressables@1.7.4/Editor/Build/DataBuilders/BuildScriptPackedMode.cs:174)
    11. UnityEditor.AddressableAssets.Build.DataBuilders.BuildScriptPackedMode.BuildDataImplementation[TResult] (UnityEditor.AddressableAssets.Build.AddressablesDataBuilderInput builderInput) (at Library/PackageCache/com.unity.addressables@1.7.4/Editor/Build/DataBuilders/BuildScriptPackedMode.cs:95)
    12. UnityEditor.AddressableAssets.Build.DataBuilders.BuildScriptBase.BuildData[TResult] (UnityEditor.AddressableAssets.Build.AddressablesDataBuilderInput builderInput) (at Library/PackageCache/com.unity.addressables@1.7.4/Editor/Build/DataBuilders/BuildScriptBase.cs:63)
    13. UnityEditor.AddressableAssets.Settings.AddressableAssetSettings.BuildPlayerContentImpl () (at Library/PackageCache/com.unity.addressables@1.7.4/Editor/Settings/AddressableAssetSettings.cs:1700)
    14. UnityEditor.AddressableAssets.Settings.AddressableAssetSettings.BuildPlayerContent () (at Library/PackageCache/com.unity.addressables@1.7.4/Editor/Settings/AddressableAssetSettings.cs:1682)
    15. UnityEditor.AddressableAssets.GUI.AddressableAssetsSettingsGroupEditor.OnBuildPlayerData () (at Library/PackageCache/com.unity.addressables@1.7.4/Editor/GUI/AddressableAssetsSettingsGroupEditor.cs:271)
    16. UnityEditor.AddressableAssets.GUI.AddressableAssetsSettingsGroupEditor.OnBuildScript (System.Object context) (at Library/PackageCache/com.unity.addressables@1.7.4/Editor/GUI/AddressableAssetsSettingsGroupEditor.cs:266)
    17. UnityEditor.GenericMenu.CatchMenu (System.Object userData, System.String[] options, System.Int32 selected) (at <6f28216fea9f453abf2e05b770ed3ee4>:0)
     
    mvaz_p and Krishx007 like this.
  2. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    210
    Flagging this for the team to have a look!
     
    Krishx007 and Ghat-Smith like this.
  3. daxiongmao

    daxiongmao

    Joined:
    Feb 2, 2016
    Posts:
    286
    Just updated and getting same thing too.
    Code (CSharp):
    1. ArgumentNullException: Value cannot be null.
    2. Parameter name: key
    3. System.Collections.Generic.Dictionary`2[TKey,TValue].FindEntry (TKey key) (at <567df3e0919241ba98db88bec4c6696f>:0)
    4. System.Collections.Generic.Dictionary`2[TKey,TValue].TryGetValue (TKey key, TValue& value) (at <567df3e0919241ba98db88bec4c6696f>:0)
    5. UnityEngine.AddressableAssets.ResourceLocators.ContentCatalogData+KeyIndexer`1[T].Add (T key, System.Boolean& isNew) (at Library/PackageCache/com.unity.addressables@1.7.4/Runtime/ResourceLocators/ContentCatalogData.cs:374)
    6. UnityEngine.AddressableAssets.ResourceLocators.ContentCatalogData+KeyIndexer`1[T].Add (System.Collections.Generic.IEnumerable`1[T] keyCollection) (at Library/PackageCache/com.unity.addressables@1.7.4/Runtime/ResourceLocators/ContentCatalogData.cs:368)
    7. UnityEngine.AddressableAssets.ResourceLocators.ContentCatalogData+KeyIndexer`1[T]..ctor (System.Collections.Generic.IEnumerable`1[T] keyCollection, System.Int32 capacity) (at Library/PackageCache/com.unity.addressables@1.7.4/Runtime/ResourceLocators/ContentCatalogData.cs:361)
    8. UnityEngine.AddressableAssets.ResourceLocators.ContentCatalogData.SetData (System.Collections.Generic.IList`1[T] data) (at Library/PackageCache/com.unity.addressables@1.7.4/Runtime/ResourceLocators/ContentCatalogData.cs:426)
    9. UnityEngine.AddressableAssets.ResourceLocators.ContentCatalogData..ctor (System.Collections.Generic.IList`1[T] entries, System.String id) (at Library/PackageCache/com.unity.addressables@1.7.4/Runtime/ResourceLocators/ContentCatalogData.cs:349)
    10. UnityEditor.AddressableAssets.Build.DataBuilders.BuildScriptPackedMode.DoBuild[TResult] (UnityEditor.AddressableAssets.Build.AddressablesDataBuilderInput builderInput, UnityEditor.AddressableAssets.Build.DataBuilders.AddressableAssetsBuildContext aaContext) (at Library/PackageCache/com.unity.addressables@1.7.4/Editor/Build/DataBuilders/BuildScriptPackedMode.cs:174)
    11. UnityEditor.AddressableAssets.Build.DataBuilders.BuildScriptPackedMode.BuildDataImplementation[TResult] (UnityEditor.AddressableAssets.Build.AddressablesDataBuilderInput builderInput) (at Library/PackageCache/com.unity.addressables@1.7.4/Editor/Build/DataBuilders/BuildScriptPackedMode.cs:95)
    12. UnityEditor.AddressableAssets.Build.DataBuilders.BuildScriptBase.BuildData[TResult] (UnityEditor.AddressableAssets.Build.AddressablesDataBuilderInput builderInput) (at Library/PackageCache/com.unity.addressables@1.7.4/Editor/Build/DataBuilders/BuildScriptBase.cs:63)
    13. UnityEditor.AddressableAssets.Settings.AddressableAssetSettings.BuildPlayerContentImpl () (at Library/PackageCache/com.unity.addressables@1.7.4/Editor/Settings/AddressableAssetSettings.cs:1700)
    14. UnityEditor.AddressableAssets.Settings.AddressableAssetSettings.BuildPlayerContent () (at Library/PackageCache/com.unity.addressables@1.7.4/Editor/Settings/AddressableAssetSettings.cs:1682)
    15. UnityEditor.AddressableAssets.GUI.AddressableAssetsSettingsGroupEditor.OnBuildPlayerData () (at Library/PackageCache/com.unity.addressables@1.7.4/Editor/GUI/AddressableAssetsSettingsGroupEditor.cs:271)
    16. UnityEditor.AddressableAssets.GUI.AddressableAssetsSettingsGroupEditor.OnBuildScript (System.Object context) (at Library/PackageCache/com.unity.addressables@1.7.4/Editor/GUI/AddressableAssetsSettingsGroupEditor.cs:266)
    17. UnityEditor.GenericMenu.CatchMenu (System.Object userData, System.String[] options, System.Int32 selected) (at C:/buildslave/unity/build/Editor/Mono/GUI/GenericMenu.cs:119)
    18.  
     
  4. luvjungle

    luvjungle

    Joined:
    Dec 18, 2017
    Posts:
    31
    same here. downgrading to 1.6.2
     
  5. KarimTA

    KarimTA

    Joined:
    Jan 8, 2019
    Posts:
    5
    Can confirme we also have the issue on our side.

    @TreyK-47 if that helps, more information after breaking on the exception, the ResourceType field of the ContentCatalogDataEntry is null for this asset:

    upload_2020-3-25_11-32-0.png upload_2020-3-25_11-35-18.png
     
  6. WaaghMan

    WaaghMan

    Joined:
    Jan 27, 2014
    Posts:
    217
    Found this issue and fixed it too. In our case it was a different asset from another 3rd party plugin, but the problem was also that ResourceType was null for an entry on the Resources folder.
     
  7. murat303

    murat303

    Joined:
    May 22, 2014
    Posts:
    25
    same thing too

    Code (CSharp):
    1. ArgumentNullException: Value cannot be null.
    2. Parameter name: key
    3. System.Collections.Generic.Dictionary`2[TKey,TValue].FindEntry (TKey key) (at <567df3e0919241ba98db88bec4c6696f>:0)
    4. System.Collections.Generic.Dictionary`2[TKey,TValue].TryGetValue (TKey key, TValue& value) (at <567df3e0919241ba98db88bec4c6696f>:0)
    5. UnityEngine.AddressableAssets.ResourceLocators.ContentCatalogData+KeyIndexer`1[T].Add (T key, System.Boolean& isNew) (at Library/PackageCache/com.unity.addressables@1.7.4/Runtime/ResourceLocators/ContentCatalogData.cs:374)
    6. UnityEngine.AddressableAssets.ResourceLocators.ContentCatalogData+KeyIndexer`1[T].Add (System.Collections.Generic.IEnumerable`1[T] keyCollection) (at Library/PackageCache/com.unity.addressables@1.7.4/Runtime/ResourceLocators/ContentCatalogData.cs:368)
    7. UnityEngine.AddressableAssets.ResourceLocators.ContentCatalogData+KeyIndexer`1[T]..ctor (System.Collections.Generic.IEnumerable`1[T] keyCollection, System.Int32 capacity) (at Library/PackageCache/com.unity.addressables@1.7.4/Runtime/ResourceLocators/ContentCatalogData.cs:361)
    8. UnityEngine.AddressableAssets.ResourceLocators.ContentCatalogData.SetData (System.Collections.Generic.IList`1[T] data) (at Library/PackageCache/com.unity.addressables@1.7.4/Runtime/ResourceLocators/ContentCatalogData.cs:426)
    9. UnityEngine.AddressableAssets.ResourceLocators.ContentCatalogData..ctor (System.Collections.Generic.IList`1[T] entries, System.String id) (at Library/PackageCache/com.unity.addressables@1.7.4/Runtime/ResourceLocators/ContentCatalogData.cs:349)
    10. UnityEditor.AddressableAssets.Build.DataBuilders.BuildScriptPackedMode.DoBuild[TResult] (UnityEditor.AddressableAssets.Build.AddressablesDataBuilderInput builderInput, UnityEditor.AddressableAssets.Build.DataBuilders.AddressableAssetsBuildContext aaContext) (at Library/PackageCache/com.unity.addressables@1.7.4/Editor/Build/DataBuilders/BuildScriptPackedMode.cs:174)
    11. UnityEditor.AddressableAssets.Build.DataBuilders.BuildScriptPackedMode.BuildDataImplementation[TResult] (UnityEditor.AddressableAssets.Build.AddressablesDataBuilderInput builderInput) (at Library/PackageCache/com.unity.addressables@1.7.4/Editor/Build/DataBuilders/BuildScriptPackedMode.cs:95)
    12. UnityEditor.AddressableAssets.Build.DataBuilders.BuildScriptBase.BuildData[TResult] (UnityEditor.AddressableAssets.Build.AddressablesDataBuilderInput builderInput) (at Library/PackageCache/com.unity.addressables@1.7.4/Editor/Build/DataBuilders/BuildScriptBase.cs:63)
    13. UnityEditor.AddressableAssets.Settings.AddressableAssetSettings.BuildPlayerContentImpl () (at Library/PackageCache/com.unity.addressables@1.7.4/Editor/Settings/AddressableAssetSettings.cs:1700)
    14. UnityEditor.AddressableAssets.Settings.AddressableAssetSettings.BuildPlayerContent () (at Library/PackageCache/com.unity.addressables@1.7.4/Editor/Settings/AddressableAssetSettings.cs:1682)
    15. UnityEditor.AddressableAssets.GUI.AddressableAssetsSettingsGroupEditor.OnBuildPlayerData () (at Library/PackageCache/com.unity.addressables@1.7.4/Editor/GUI/AddressableAssetsSettingsGroupEditor.cs:271)
    16. UnityEditor.AddressableAssets.GUI.AddressableAssetsSettingsGroupEditor.OnBuildScript (System.Object context) (at Library/PackageCache/com.unity.addressables@1.7.4/Editor/GUI/AddressableAssetsSettingsGroupEditor.cs:266)
    17. UnityEditor.GenericMenu.CatchMenu (System.Object userData, System.String[] options, System.Int32 selected) (at /Users/builduser/buildslave/unity/build/Editor/Mono/GUI/GenericMenu.cs:119)
    18.  
     
  8. inyman

    inyman

    Joined:
    Oct 24, 2015
    Posts:
    8
    Same issue here.

    Downgrading to 1.6.2 fixed the issue
     
  9. KarimTA

    KarimTA

    Joined:
    Jan 8, 2019
    Posts:
    5
    How did you fix the issue on your end?
     
  10. paulCellarDoor

    paulCellarDoor

    Joined:
    Mar 18, 2019
    Posts:
    1
    Yeah, we're running into this issue as well. How did you solve the 'ResourceType was null' issue?

    Just to add, like the others here, if I downgrade to 1.6.2, I don't get that exception.
     
    Last edited: Mar 27, 2020
  11. KB73

    KB73

    Joined:
    Feb 7, 2013
    Posts:
    218
    Egil-Sandfeld likes this.
unityunity