Search Unity

Problem abount using AAS 0.4.6

Discussion in 'Addressables' started by itthereforeim, Oct 30, 2018.

  1. itthereforeim

    itthereforeim

    Joined:
    Apr 28, 2014
    Posts:
    24
    Hey, I got this error while I am using AAS 0.4.6
    And I have no way back, but delete all setting files

    AAS 0.4.6
    Reproduce step:
    1. Create AAS environment
    2. Add two group, add several resources into these groups
    3. Close Unity and Restart Unity
    4. Now, you can't add or delete group anymore
    The only way back is delete all setting files

    Here is the error callstack:

    NullReferenceException: Object reference not set to an instance of an object
    UnityEditor.AddressableAssets.BundledAssetGroupSchema.get_HostingServicesContentRoot () (at C:/Users/user/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.addressables@0.4.6-preview/Editor/Settings/GroupSchemas/BundledAssetGroupSchema.cs:118)
    UnityEditor.AddressableAssets.HostingServicesManager.GetAllContentRoots () (at C:/Users/user/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.addressables@0.4.6-preview/Editor/HostingServices/HostingServicesManager.cs:393)
    UnityEditor.AddressableAssets.HostingServicesManager.ConfigureAllHostingServices () (at C:/Users/user/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.addressables@0.4.6-preview/Editor/HostingServices/HostingServicesManager.cs:372)
    UnityEditor.AddressableAssets.HostingServicesManager.OnSettingsModification (UnityEditor.AddressableAssets.AddressableAssetSettings s, ModificationEvent evt, System.Object obj) (at C:/Users/user/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.addressables@0.4.6-preview/Editor/HostingServices/HostingServicesManager.cs:365)
    UnityEditor.AddressableAssets.AddressableAssetSettings.SetDirty (ModificationEvent modificationEvent, System.Object eventData, Boolean postEvent) (at C:/Users/user/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.addressables@0.4.6-preview/Editor/Settings/AddressableAssetSettings.cs:865)
    UnityEditor.AddressableAssets.AddressableAssetGroup.SetDirty (ModificationEvent modificationEvent, System.Object eventData, Boolean postEvent) (at C:/Users/user/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.addressables@0.4.6-preview/Editor/Settings/AddressableAssetGroup.cs:443)
    UnityEditor.AddressableAssets.AddressableAssetGroup.AddSchema (System.Type type, Boolean postEvent) (at C:/Users/user/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.addressables@0.4.6-preview/Editor/Settings/AddressableAssetGroup.cs:134)
    UnityEditor.AddressableAssets.AddressableAssetSettings.CreateGroup (System.String groupName, Boolean setAsDefaultGroup, Boolean readOnly, Boolean postEvent, System.Type[] types) (at C:/Users/user/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.addressables@0.4.6-preview/Editor/Settings/AddressableAssetSettings.cs:1054)
    UnityEditor.AddressableAssets.AddressableAssetEntryTreeView.CreateNewGroup (System.Object context) (at C:/Users/user/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.addressables@0.4.6-preview/Editor/GUI/AddressableAssetsSettingsGroupTreeView.cs:807)
    UnityEditor.GenericMenu.CatchMenu (System.Object userData, System.String[] options, Int32 selected) (at C:/buildslave/unity/build/Editor/Mono/GUI/GenericMenu.cs:119)
     
    Last edited: Oct 30, 2018
    RecursiveFrog likes this.
  2. itthereforeim

    itthereforeim

    Joined:
    Apr 28, 2014
    Posts:
    24
    Here is the bug reproduce project

    using Unity 2018.2.13f1
     

    Attached Files:

    Last edited: Oct 30, 2018
  3. itthereforeim

    itthereforeim

    Joined:
    Apr 28, 2014
    Posts:
    24
    I guess I found the reason why AAS keeps throw this error message

    The reason is BundledAssetGroupSchema's .asset file did not SetDirty in somewhere
    So it will lose ProfileValueReference instance after restart Unity

    I can fix this problem by myself, in two ways
    but I wish, AAS team could provide fixed version later...

    1. Lazy way:
    Execute this API after AAS data updated
    AssetDatabase.ForceReserializeAssets();

    2. The same way like solution 1, but manually load all AAS .asset files
    makes them dirty ensure they could be saved correctly after AAS data updated.
     

    Attached Files:

  4. iamarugin

    iamarugin

    Joined:
    Dec 17, 2014
    Posts:
    112
    Same problem here.
    AAS 0.4.8
     
  5. itthereforeim

    itthereforeim

    Joined:
    Apr 28, 2014
    Posts:
    24
    Where I can get 0.4.8?
     
  6. RecursiveFrog

    RecursiveFrog

    Joined:
    Mar 7, 2011
    Posts:
    142
    The script attached to the thread doesn't work for me. I still receive this error, 3 times, every time I save my scene.

    I wonder if this is because I updated my Unity version, and in the process all my metas were reimported?
     
  7. unity_bill

    unity_bill

    Unity Technologies

    Joined:
    Apr 11, 2017
    Posts:
    680
    Thanks for letting us know, I've filed a bug in our system.

    as to the "where can I get 0.4.8", it's out now, but as of when you asked the question it was not. Some users have discovered how to get our test builds of addressables before they are released. Doing this is a terrible idea. As you can see by the fact that our first released 0.4.x was 0.4.6, we had 6 builds of addressables that didn't work. We create a build for internal testing, test, fix, repeat. Once it's stable enough, we release it. So attempting to access the test builds is a recipe for running into weird bugs, and potentially nuking your data. I would not recommend it.

    -Bill
     
    optimise likes this.
  8. RDeluxe

    RDeluxe

    Joined:
    Sep 29, 2013
    Posts:
    86
    I'm encountering the same issue here.
     
  9. CapnCromulent

    CapnCromulent

    Joined:
    Sep 7, 2010
    Posts:
    43
    @unity_bill Is this bug in the issue tracker? Or in an internal list?

    To the others experiencing the bug: is the only solution right now to delete and start over, and saving each time using ittheforeim's script?
     
  10. niX_BB

    niX_BB

    Joined:
    Mar 29, 2010
    Posts:
    26
    @CapnCromulent I can confirm that deleting AddressableAssetData and using @itthereforeim's script before closing the editor avoids the bug.

    I previously got the error when trying to create a new group or trying to fix duplicate references with the analyze tool.

    edit: And thank you @itthereforeim for the work around it saved me a lot of time. ;)
     
    Last edited: Dec 5, 2018