Search Unity

"invalid targetHash" and "it->second.IsValid()" on load after upgrade to 2019.3

Discussion in 'Editor & General Support' started by RoyBarina, Feb 4, 2020.

  1. RoyBarina

    RoyBarina

    Joined:
    Jul 3, 2017
    Posts:
    98
    Hello :)

    After upgrading my project from 2019.2.17f1 to 2019.3.0f6 I keep getting these two error messages (two of each) after loading the project.

    2x GetLoadedImportedAssetsAndTargetHashes called with invalid targetHash
    2x Assertion failed on expression: 'it->second.IsValid()'


    After clearing the console it seems like everything works ok but those messages always comes when reloading the project.

    I really don't know where those messages came from or what they relate to
    So I tried clearing shader graph cache and completely deleted VisualEffectGraph package and its related files (which cause another problem preventing me from export my project to Android)

    I did file a bug report only to get an email back saying I have to use the latest version of Unity.. I guess if you use the latest official release you're not allowed to report bugs? :S

    Edit:
    One thing may be related is that in my project I do not use assembly references as the "URP upgrade" guide suggests
    This guide only suggests to modify them if they exists in the project so it feels natural to skip this step as I do not use them at all...
     
    Last edited: Feb 6, 2020
  2. TextusGames

    TextusGames

    Joined:
    Dec 8, 2016
    Posts:
    429
    I am gaetting this errors too.
     
  3. arminelec

    arminelec

    Joined:
    Jul 16, 2015
    Posts:
    4
    I have the same issue.
    When I switched back to Asset Pipeline v1 (on 2019.3.0f6), I no longer see this error.
    Although, I switched to v1 just to see whether it was related to v2 or not. My test included clearing the cache and cleaning up generated files (temp, lib, etc.) as well. I have switched back to v2 and get the error again.
    I hope someone from Unity can shed more light on this.
     
  4. RoyBarina

    RoyBarina

    Joined:
    Jul 3, 2017
    Posts:
    98
    I just got emailed from Unity QA team saying that is a known issue and can be tracked here:
    https://issuetracker.unity3d.com/product/unity/issues/guid/1193970
    But for me it seems the link is broken :S and I can't find that issue with that GUID or by name
    So I email them back for a proper link :)

    That issue doesn't interrupt my workflow at all it just pinching my eye to see errors in my project :p
     
  5. alexvector

    alexvector

    Joined:
    Oct 9, 2019
    Posts:
    26
    We also get a bunch of these errors in our project (2019.3.1f1)

    Many
    GetLoadedImportedAssetsAndTargetHashes called with invalid targetHash
    (Filename: C:\buildslave\unity\build\Modules/AssetDatabase/Editor/V2/LoadedAssetManager.cpp Line: 234)

    followed by many
    Assertion failed on expression: 'it->second.IsValid()'
    (Filename: C:\buildslave\unity\build\Modules/AssetDatabase/Editor/V2/LoadedAssetManager.cpp Line: 283)

    These happen when opening the project after getting files from perforce that were added by another team member.
     
  6. TextusGames

    TextusGames

    Joined:
    Dec 8, 2016
    Posts:
    429
    Try to clear the library folder. But back up your project first.
     
    IdoDev likes this.
  7. almosr

    almosr

    Joined:
    Jul 16, 2017
    Posts:
    14
    I started to get these errors after I added External Dependency Manager for Unity and Firebase to the project.
     
    phobos2077 and krisventure like this.
  8. olejuer

    olejuer

    Joined:
    Dec 1, 2014
    Posts:
    211
    I get those when calling Resources.LoadAll<>() from a method tagged with [UnityEditor.InitializeOnLoadMethod]. Maybe, the method is executed before the editor is ready to call Resources.
    I cannot reproduce this in a new project, though.
     
    Last edited: Apr 17, 2020
  9. S4UC1SS0N

    S4UC1SS0N

    Joined:
    May 29, 2014
    Posts:
    49
    I also get these errors (x2) on Unity startup since i updated to 2019.3.11f1
     
  10. XochiInteractive

    XochiInteractive

    Joined:
    May 21, 2018
    Posts:
    19
    I'm using Unity version 2019.3.11f1 as well and have received these errors. I started a new project and imported various packages from the Package Manager as well as purchased assets. I cleared all of the errors caused by assets and I'm now left with these errors (Shown in screenshot below). I'm working on the top error, but don't know how to resolve the bottom two. If someone finds out, I'd love to know how. NOTE: I do not have an Atlases folder within my Assets folder, I followed the link provided above in this thread and was not successful in resolving this error. upload_2020-5-1_1-32-1.png
     
  11. olejuer

    olejuer

    Joined:
    Dec 1, 2014
    Posts:
    211
    Probably not related, but I recommend not to use spaces in path names, because that often causes problems. Might even help here, who knows?
     
  12. n3xxt

    n3xxt

    Joined:
    Dec 14, 2019
    Posts:
    1
    Hi everyone,

    I have just downloaded the Unity Hub, installed latest version 2019.3.12f1 Personal and got this error just by importing a purchased asset from the store, whereas this issue suggests that this only happens on "deleting packed atlases":

    [2D] "INVALID TARGETHASH" AND "ASSERTION FAILED" ERROR MESSAGES WHEN DELETING PACKED ATLASES
    https://issuetracker.unity3d.com/is...d-error-messages-when-deleting-packed-atlases

    The following path (default by Unity) contains all three: (1) a space (2) a dot (3) Hyphen-minus (&#45;) in the folder name which cannot be changed:

    C:\Users\%%USERNAME%%\AppData\Roaming\Unity\Asset Store-5.x


    To address a foreseeable response "use LTS instead" I would just place this link here:

    https://forum.unity.com/threads/the-state-of-unity-packages-in-2020.841159/page-8

    Complete list of errors just by loading an asset into HDRP mode:

    Code (CSharp):
    1. GetLoadedImportedAssetsAndTargetHashes called with invalid targetHash
    2. GetLoadedImportedAssetsAndTargetHashes called with invalid targetHash
    3. Assertion failed on expression: 'it->second.IsValid()'
    4. Assertion failed on expression: 'it->second.IsValid()'
    The above errors got doubled themselves exactly as quoted with the same timestamp to the second [07:15:17] meaning the same event has triggered all 4 errors at once.
     
    Last edited: May 3, 2020
  13. Ghetaldus

    Ghetaldus

    Joined:
    Jul 15, 2017
    Posts:
    46
    I have just started getting these too. Happens when I load project as well and it seems to have started after installing External Dependency Manager for Firebase. Unity version is latest 2019.4.1f1.
     
  14. almosr

    almosr

    Joined:
    Jul 16, 2017
    Posts:
    14
    I have managed to get rid of it by deleting the Library folder and re-open the project.
     
  15. Ghetaldus

    Ghetaldus

    Joined:
    Jul 15, 2017
    Posts:
    46
    Yep, deleting Library folder helped. Thanks!
     
    Jeremy-Borton and phobos2077 like this.
  16. Ghetaldus

    Ghetaldus

    Joined:
    Jul 15, 2017
    Posts:
    46
    Hm, as soon as I updated firebase in package manager errors have returned. Is it same for you?
     
  17. tyapichu

    tyapichu

    Joined:
    Aug 11, 2013
    Posts:
    11
    if you don't add google Custom Package Manager, it wont bother you.
     
  18. krisventure

    krisventure

    Joined:
    Mar 24, 2016
    Posts:
    118
    It was probably something else you've changed that fixed it. I also started to have these otherwise harmless error messages after importing External Dependency Manager but after deleting and re-creating the library folder the error messages persist.
    Not to mention the automatic Library re-creation somehow failed (all my project settings has been reset to default) and I had to restore my project from backup.
     
  19. almosr

    almosr

    Joined:
    Jul 16, 2017
    Posts:
    14
    It was working for me right away after I deleted the library folder. Maybe your problem was different with a similar symptom.
    Some settings are stored in the library folder, I find it rather annoying, TBH. I ended up creating a script that sets up all important settings because I don't want to check in the library folder into my repo. Lots of the content keeps changing every time I open the project.
     
  20. ElvisGC

    ElvisGC

    Joined:
    Mar 17, 2022
    Posts:
    1
    Alguien sabe como arreglar esto por favor !!!

    upload_2022-3-31_3-41-47.png
     

    Attached Files:

  21. Jeremy-Borton

    Jeremy-Borton

    Joined:
    Oct 21, 2015
    Posts:
    63
    I just updated to unity 2022 and deleting the library folder, and then reopening the project worked. Thank you. Above answers worked for me. Thanks!
     
  22. OxDEADFACE

    OxDEADFACE

    Joined:
    Jul 6, 2017
    Posts:
    33
    lmao, yep.

    YADYLFI
    (Yet Another Delete Your Library Folder Issue)

    it's 2023
     
    RoyBarina likes this.