Search Unity

(Case 1119066) settings.json not generated because of LinkXml.Save() NullReference Exception

Discussion in 'Addressables' started by MNNoxMortem, Jan 21, 2019.

  1. MNNoxMortem

    MNNoxMortem

    Joined:
    Sep 11, 2016
    Posts:
    723
    Has anyone else encountered the same error and possibly found a workaround (0.5.3+Unity 2018.3.2f1)? From time to time this happens and the only way to fix it so far was to recreate ALL addressable settings (which is really annoying and a lot of work).

    Code (CSharp):
    1. [Exception] NullReferenceException: Object reference not set to an instance of an object
    2. LinkXmlGenerator.Save()    Library/PackageCache/com.unity.addressables@0.5.3-preview/Editor/Build/LinkXMLGenerator.cs:29
    3. 27:   foreach (var t in m_Types)
    4. 28:   {
    5. -->29:       var a = t.Assembly;
    6. 30:       List<Type> types;
    7. 31:       if (!assemblyMap.TryGetValue(a, out types))
    8.  
    9. BuildScriptPackedMode.BuildData[TResult]()    Library/PackageCache/com.unity.addressables@0.5.3-preview/Editor/Build/DataBuilders/BuildScriptPackedMode.cs:186
    10. 184:   }
    11. 185:   linker.AddTypes(typeof(Addressables));
    12. -->186:   linker.Save(Addressables.BuildPath + "/link.xml");
    13. 188:   WriteFile(settingsPath, JsonUtility.ToJson(runtimeData));
    14.  
    15. AddressableAssetSettings.BuildPlayerContent()    Library/PackageCache/com.unity.addressables@0.5.3-preview/Editor/Settings/AddressableAssetSettings.cs:1307
    16. 1305:           EditorUserBuildSettings.activeBuildTarget, EditorUserBuildSettings.development,
    17. 1306:           ProjectConfigData.postProfilerEvents, settings.PlayerBuildVersion);
    18. -->1307:       settings.ActivePlayerDataBuilder.BuildData<AddressablesPlayerBuildResult>(buildContext);
    19. 1308:   }
    20.  
    21. AddressableAssetsSettingsGroupEditor.OnBuildPlayerData()    Library/PackageCache/com.unity.addressables@0.5.3-preview/Editor/GUI/AddressableAssetsSettingsGroupEditor.cs:224
    22. 222:   void OnBuildPlayerData()
    23. 223:   {
    24. -->224:       AddressableAssetSettings.BuildPlayerContent();
    25. 225:   }
    26.  
    27. GenericMenu.CatchMenu()    C:/buildslave/unity/build/Editor/Mono/GUI/GenericMenu.cs:121
    28.  
    Would actually create a small project for this if I had any idea how/when/why it happens but I have not the slightest clue at the moment.
     
    Last edited: Jan 21, 2019