Search Unity

Feedback Changing namespace of class causes an error durring build

Discussion in 'Addressables' started by HedgehogNSK, Apr 22, 2020.

  1. HedgehogNSK

    HedgehogNSK

    Joined:
    Jun 3, 2017
    Posts:
    24
    Addressables Ver.1.7.5.
    I've changed sub-namespace of some classes which instances are adressables. And then I've got an error in time of build in AddressableAssetEntry.cs next property:
    Code (CSharp):
    1. internal Type MainAssetType
    2.         {
    3.             get
    4.             {
    5.                 if (string.IsNullOrEmpty(m_mainAssetType))
    6.                 {
    7.                     m_mainAssetType = AssetDatabase.GetMainAssetTypeAtPath(AssetPath)?.AssemblyQualifiedName;
    8.                     if (string.IsNullOrEmpty(m_mainAssetType))
    9.                         return typeof(object); // do not cache a bad type lookup.
    10.                 }
    11.                 return Type.GetType(m_mainAssetType);
    12.             }
    13.         }
    Property is trying to get type from m_mainAssetType. And the value of this variable haven't changed after I renamed my class

    Text of the error if it is needed:
    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. UnityEditor.AddressableAssets.Settings.AddressableAssetEntry.CreateCatalogEntries (System.Collections.Generic.List`1[T] entries, System.Boolean isBundled, System.String providerType, System.Collections.Generic.IEnumerable`1[T] dependencies, System.Object extraData, System.Collections.Generic.HashSet`1[T] providerTypes) (at Library/PackageCache/com.unity.addressables@1.7.5/Editor/Settings/AddressableAssetEntry.cs:661)
    3. UnityEditor.AddressableAssets.Build.BuildPipelineTasks.GenerateLocationListsTask.CreateResourceLocationData (UnityEditor.AddressableAssets.Settings.AddressableAssetGroup assetGroup, System.String bundleName, System.String bundleInternalId, System.String bundleProvider, System.String assetProvider, System.Collections.Generic.List`1[T] assetsInBundle, System.Collections.Generic.HashSet`1[T] bundleDependencies, System.Collections.Generic.List`1[T] locations, System.Collections.Generic.HashSet`1[T] providerTypes) (at Library/PackageCache/com.unity.addressables@1.7.5/Editor/Build/BuildPipelineTasks/GenerateLocationListsTask.cs:149)
    4. UnityEditor.AddressableAssets.Build.BuildPipelineTasks.GenerateLocationListsTask.Run (UnityEditor.AddressableAssets.Build.DataBuilders.IAddressableAssetsBuildContext aaBuildContext, UnityEditor.Build.Pipeline.Interfaces.IBundleWriteData writeData) (at Library/PackageCache/com.unity.addressables@1.7.5/Editor/Build/BuildPipelineTasks/GenerateLocationListsTask.cs:96)
    5. 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.5/Editor/Build/DataBuilders/BuildScriptPackedMode.cs:148)
    6. UnityEditor.AddressableAssets.Build.DataBuilders.BuildScriptPackedMode.BuildDataImplementation[TResult] (UnityEditor.AddressableAssets.Build.AddressablesDataBuilderInput builderInput) (at Library/PackageCache/com.unity.addressables@1.7.5/Editor/Build/DataBuilders/BuildScriptPackedMode.cs:95)
    7. UnityEditor.AddressableAssets.Build.DataBuilders.BuildScriptBase.BuildData[TResult] (UnityEditor.AddressableAssets.Build.AddressablesDataBuilderInput builderInput) (at Library/PackageCache/com.unity.addressables@1.7.5/Editor/Build/DataBuilders/BuildScriptBase.cs:63)
    8. UnityEditor.AddressableAssets.Settings.AddressableAssetSettings.BuildPlayerContentImpl () (at Library/PackageCache/com.unity.addressables@1.7.5/Editor/Settings/AddressableAssetSettings.cs:1700)
    9. UnityEditor.AddressableAssets.Settings.AddressableAssetSettings.BuildPlayerContent () (at Library/PackageCache/com.unity.addressables@1.7.5/Editor/Settings/AddressableAssetSettings.cs:1682)
    10. UnityEditor.AddressableAssets.GUI.AddressableAssetsSettingsGroupEditor.OnBuildPlayerData () (at Library/PackageCache/com.unity.addressables@1.7.5/Editor/GUI/AddressableAssetsSettingsGroupEditor.cs:271)
    11. UnityEditor.AddressableAssets.GUI.AddressableAssetsSettingsGroupEditor.OnBuildScript (System.Object context) (at Library/PackageCache/com.unity.addressables@1.7.5/Editor/GUI/AddressableAssetsSettingsGroupEditor.cs:266)
    12. UnityEditor.GenericMenu.CatchMenu (System.Object userData, System.String[] options, System.Int32 selected) (at <92f998fbb4ca4d8dab7793d6e003b794>:0)
    13.  
     
  2. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,822
    Thanks for the report. I'll kick this over to the team for them to have a look!
     
  3. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,822
    I connected with the team on this. Looks like something similar to this is being fixed in the release after 1.8.3. See if that release fixes this. If not, please let us know.