Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  3. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Bug Importer(MonoImporter) generated inconsistent result for asset

Discussion in '2020.2 Beta' started by Hyp-X, Dec 8, 2020.

  1. Hyp-X

    Hyp-X

    Joined:
    Jun 24, 2015
    Posts:
    438
    When I reimport a folder in our project containing scripts I get this for all the scripts in there.

    Here's an example:
    Importer(MonoImporter) generated inconsistent result for asset(guid:124ceec668bddc3458259a2cc6ebd3be) "Packages/com.kite.rendering/Runtime/RenderTargetHandle.cs"


    Reimporting again doesn't fix the issue.

    - Does this mean the import generates a different result each time?
    - Or does it mean when the reimport generates a different result it is not stored in the AssetDatabase?
    (That would defeat the purpose of reimport, because if there's one faulty import there would be no way to collect it.)
    - What is even generated from a C# script can be inconsistent?
    - Is this our fault, or a Unity bug?
     
    futurlab_xbox and Rallix like this.
  2. Rallix

    Rallix

    Joined:
    Mar 17, 2016
    Posts:
    139
    I also wanted to ask about the same thing.
    I started getting these "inconsistent result for asset" warnings in 2020.2, too. Occasionally for some random scripts, but consistently for the URP forward renderer asset (when I save a scene, etc.):
    Importer(NativeFormatImporter) generated inconsistent result for
    asset(guid:4a8e21d5c33334b11b34a596161b9360)
    "Assets/Rpg/Core/Settings/ForwardRenderer.asset"


    I have essentially the same questions:
    – Is it my fault or a bug?
    – Is there a way to resolve it, when reimporting doesn't help?
     
  3. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136
    I've forwarded your questions to the team.
     
    Rallix likes this.
  4. henriksc

    henriksc

    Unity Technologies

    Joined:
    Aug 27, 2020
    Posts:
    30
    Hi

    This message means that the generated asset artifact is different from the previous import, even though the input and dependencies were the same. We've recently updated the 20.2 docs to include more information about the consistency checker.

    https://docs.unity3d.com/2020.2/Documentation/Manual/ImporterConsistency.html

    There is examples of how to debug the result, so you could compare the import result, and there is more information in the editor.log about the found inconsistency.

    However, this looks to be a bug in Unity and very much like something we've recently found and fixed in the serialised file header. We had an issue where a couple bytes in the header would be random garbage. You can "check" this by using the binary2text tool on the previous and new import result. If there is no difference between those two, then it's likely the garbage byte.

    Also, if you upload the library files and logs, I'll happily take a look.
     
  5. Rallix

    Rallix

    Joined:
    Mar 17, 2016
    Posts:
    139
    Hi,
    thank you very much for the thorough explanation!

    It does seem to be a bug – I ran
    -consistencyCheck
    on the project, and it pointed out "inconsistent results" even in Unity packages like Input System, Shader Graph etc., alongside with my own scripts, assets and folders.
    I checked the Forward Renderer Data asset, specifically, because it pops up regularly – and the files seem to be identical; at least binary2text output is.

    (This error also appeared during the consistency check a few times; I'm putting it here just for the sake of completeness.)
    Assertion failed on expression: 'ins.second || ins.first->second == artifactID || (ins.first->second == CircularDependencyArtifactID() && !artifactID.IsValid()) || GetPathFromAssetGuidV2(key.GetGUID()).ends_with(".cs")'
     

    Attached Files:

    Last edited: Dec 12, 2020
    Tymianek, futurlab_xbox and pahe like this.
  6. pahe

    pahe

    Joined:
    May 10, 2011
    Posts:
    543
    Yeah, seems like there's something seriously broken right now. I'm on 2020.2b14 and get many of those warning which block me from testing my game.

    @henriksc would you advice to go back to a previous version of the editor and see if the errors go away or would should be the best way to fix the issues?
     
  7. Hyp-X

    Hyp-X

    Joined:
    Jun 24, 2015
    Posts:
    438
    How recently?
    Is the fix in b13 or b14 or still unreleased?
    I'm asking because I frequently switch back and forth between b13 and b14 because of various issues.
    I'll do the compare if needed, but if I'm on a version with a known bug than I won't bother.
     
  8. henriksc

    henriksc

    Unity Technologies

    Joined:
    Aug 27, 2020
    Posts:
    30
    The fix hasn't been backported to 20.2 yet. It's currently only available in 21.1a9. I'll update this thread once it does.

    It would be interesting to hear if you observe a difference between certain Unity versions. But I don't think it will help you in your case.

    Also worth noting, the warnings from the consistency checker does not mean builds or editor is broken. It's highlighting potential workflow issues down the line about editor determinism. An import will still work even if it's flagged as being inconsistent. So if you experience that the warnings prevent you from testing your game, then I would very much like to hear some more details about how, so we can rectify the issues.
     
  9. pahe

    pahe

    Joined:
    May 10, 2011
    Posts:
    543
    Alright, good to hear, as I was concerned about it. I'm experiencing a strange problem with one of my code files and the warning is mentioning a config file which relates to that code. So I was wondering if that is causing the problem or not. I'll investigate a bit more what the problem is and submit a bug report if I find anything which is not on our side.
     
  10. henriksc

    henriksc

    Unity Technologies

    Joined:
    Aug 27, 2020
    Posts:
    30
    Thank you :)
     
  11. _slash_

    _slash_

    Joined:
    Mar 26, 2013
    Posts:
    37
    Is there an ETA for the backport?
    This is still in 2020.2 Release f01...
     
    Thygrrr likes this.
  12. Rallix

    Rallix

    Joined:
    Mar 17, 2016
    Posts:
    139
    I still experience this problem in the new 2021.1.0b4, though (always when I save a scene).
    Is the issue supposed to be fixed in that version?
     

    Attached Files:

  13. henriksc

    henriksc

    Unity Technologies

    Joined:
    Aug 27, 2020
    Posts:
    30
    Yes, it's supposed to be fixed in 21.1.0b4(still waiting for backport to 20.2, but it got bumped today).

    Noticed from your gif that it was what seemed to be the forward rendering settings native asset. So I tried to reproduce it using a test project with URP, but haven't had any success.

    Would you be able to share a minimal project where this reproduces for you?
     
  14. Rallix

    Rallix

    Joined:
    Mar 17, 2016
    Posts:
    139
    I sent one. Case 1310981. It's related to the same Forward Renderer URP asset I mentioned earlier in the thread.

    Although you should know I can't replicate the bug anymore in a new test project nor when I do a full project reimport (i.e. deleting the Library folder or “Reimport All”) in the beta version. Still, it seems the consistency checker problem was carried over from 2020.2 and persists even after the updates or when I try to “Reimport” only the one problematic asset.

    Therefore if someone (like me) encountered the issue in 20.2 and didn't do a full project reimport after updating to 21.1, they might still get the warnings.
     
    futurlab_xbox likes this.
  15. henriksc

    henriksc

    Unity Technologies

    Joined:
    Aug 27, 2020
    Posts:
    30
    Thanks ... Our QA has managed to reproduce it, so we'll take a deep took.
     
    futurlab_xbox likes this.
  16. futurlab_xbox

    futurlab_xbox

    Joined:
    Nov 5, 2018
    Posts:
    22
    Is it possible that this issue may be affecting lightmaps as well? We've already spent days hunting down the causes of a lighting issue happening to most of our builds. This is how it looks on Editor and on builds coming from some PCs:
    upload_2021-3-9_10-4-20.png

    And this is how it looks on builds coming from our build server and eventually from a couple other PCs:
    upload_2021-3-9_10-5-33.png

    Sometimes we get messages like this one affecting lightmaps and lighting data assets:

    Importer(NativeFormatImporter) generated inconsistent result for asset(guid:4408f65abb86b7e47844131dbf0dc42d) "Assets/PWS/Scenes/Game/Game_ResidentialSmall_Backyard/LightingData.asset"

    This has been reproduced on Unity 2020.2.2f1, 2020.2.5f1 and 2020.2.7f1. We tried purging the Accelerator cache and also disabling it altogether, deleting the Library folder, without success. We were unable to isolate the issue, which is why we haven't reported a bug yet. I tried opening editor with
    -consistencyCheck
    and got 999+ "inconsistent results" warnings, so I suspect the issue isn't in our code but an Unity bug.

    We're now preparing a build using 2021.1.0b10.2062, will reply to this post with its results once they're available.
     
  17. hawaiian_lasagne

    hawaiian_lasagne

    Joined:
    May 15, 2013
    Posts:
    127
    I'm seeing this too now after upgrading my project from 2020 to 20201.1.1f1. For me the error is occuring on the Global Volume Profile post processing asset, which is causing my post process not to work.
     
  18. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136
    Rallix and futurlab_xbox like this.
  19. Rallix

    Rallix

    Joined:
    Mar 17, 2016
    Posts:
    139
    @LeonhardP Unfortunately, this seems to pop up again after I updated to 2021.2.0a19 (previously, a16 and a17 were fine).
    Same problem, same reproduction steps. Saving a scene or manually reimporting shows the warning.

    When manually reimporting the Universal Renderer Data asset:
    Code (CSharp):
    1. Importer(NativeFormatImporter) generated inconsistent result for asset(guid:8aa25a71635ef2140bcab240d45a5687) "Assets/Rpg/Core/Settings/URP/URP.asset"
    2. UnityEditor.RetainedMode:UpdateSchedulers ()
    Reimporting a scene:
    Code (CSharp):
    1. Importer(DefaultImporter) generated inconsistent result for asset(guid:500251ccce6614d4baabf5558d24e1c5) "Assets/Rpg/Levels/_Test/Playground/Playground.unity"

    Edit:
    I ran a
    -consistencyCheck
    on the project and it found problems in almost everything, e.g.:
    Code (CSharp):
    1. ConsistencyChecker - guid: b5654879e399f0a42abf0e92a05b1eaf, dependenciesHash.value: 417f59c3aa5d7aed7a76ce87356ec873, artifactid: 0e9ef3e44918c2cba848e551c375a8d6, producedFiles[0].extension: , producedFiles[0].contentHash: dce563842f3a9ccb1b19fbc20643a8ee
    2. ConsistencyChecker - guid: b5654879e399f0a42abf0e92a05b1eaf, dependenciesHash.value: 417f59c3aa5d7aed7a76ce87356ec873, artifactid: 5dd549f110adece659649372ea767981, producedFiles[0].extension: , producedFiles[0].contentHash: dce563842f3a9ccb1b19fbc20643a8ee
    3. Importer(TextScriptImporter) generated inconsistent result for asset(guid:b5654879e399f0a42abf0e92a05b1eaf)
    4. "Packages/com.unity.addressables/readme.md"
     
    Last edited: Jun 5, 2021
    futurlab_peterh likes this.
  20. LegoCylon

    LegoCylon

    Joined:
    Nov 24, 2016
    Posts:
    2
    I was still getting this in 2020.3.11f1 until I did a Reimport All on the project. Now I can reimport individual files/folders without triggering this warning.
     
  21. Rallix

    Rallix

    Joined:
    Mar 17, 2016
    Posts:
    139
    Yes, but in my experience, it's only temporary. And “Reimport All” is essentially an overnight process, so I don't want to do that too often.
     
    michaeleconomy likes this.
  22. bome99

    bome99

    Joined:
    Sep 14, 2009
    Posts:
    119
    I have this issue in my project.
    Deleting Library or Reimporting doesn't work. I've also tried deleting the prefab and making it again and still the same result.
    Is there a way of disabling the check for inconsistencies?

    I have tried in versions 2021.1.24f1. 2021.2.15f1 and 20213.3f1
     
    futurlab_peterh likes this.
  23. henriksc

    henriksc

    Unity Technologies

    Joined:
    Aug 27, 2020
    Posts:
    30
    @bome99 do you have any post processors or other code that could be modifying the asset after or during the import?

    Currently there isn't a way to disable the consistency checker.
     
  24. xucian

    xucian

    Joined:
    Mar 7, 2016
    Posts:
    850
    Also happens in 2021.3.4f1
    Importer(TextureImporter) generated inconsistent result for asset(guid:a91454a58f6257d4396ab45a166d7d43) "Assets/Plugins/TextMesh Pro/ResourcesCompat/TMPro/Sprites/items_icons_2.png"

    If I rename it to items_icons_3.png, the error disappears. I tried disabling Accelerator, with no luck
     
  25. henriksc

    henriksc

    Unity Technologies

    Joined:
    Aug 27, 2020
    Posts:
    30
    _slash_ and xucian like this.
  26. grobonom

    grobonom

    Joined:
    Jun 23, 2018
    Posts:
    335
    I got those errors on blender files ( through fbx importer on 2022.1.0f1

    I uninstall it and give a try to 2022.1.6f1 ( as am unable to connect to update server.... )

    it is bad IMHO that unity raises such error with so few information:
    << i imported your model but it is broken >>
    And now what ?
    U3D should say more about what is broken ! mostly because user can do nothing inside U3D to solve the problem ;)
     
  27. grobonom

    grobonom

    Joined:
    Jun 23, 2018
    Posts:
    335
    strange....

    editing and saving the model with blender and importing to 2022.1.6 works with no error.
    R-click on the file in project and choosing reimport raises the error...
    Looks like it is some bug^^
     
  28. detzt

    detzt

    Joined:
    Oct 6, 2018
    Posts:
    23
    After upgrading from 2021 to Unity 2022.1.7, we get this warning upon reimporting any .asset file (mostly ScriptableObjects).

    ConsistencyChecker - guid: 216cf4e0e65a6fb4381c1bd92fb77c16, dependenciesHash.value: 298d625d893d1456edfa6bcc84359056, artifactid: 49927163b8afc3f0422ff2a97019eea0, producedFiles[0].extension: , producedFiles[0].contentHash: 8a08c766c149aa5e93ffc25894e2d697
    ConsistencyChecker - guid: 216cf4e0e65a6fb4381c1bd92fb77c16, dependenciesHash.value: 298d625d893d1456edfa6bcc84359056, artifactid: e8293c57d11b048c0caf20d11f36de77, producedFiles[0].extension: , producedFiles[0].contentHash: 2025297025472bc430e2ff167b5567c0


    The contentHash is always the same pair of values even for different ScriptableObjects.
    The two binary files differ, but running it through binary2text gave the same output text.
    I attached the 4 files if that is any help.
     

    Attached Files:

  29. Tortuap

    Tortuap

    Joined:
    Dec 4, 2013
    Posts:
    137
    Still have this behaviour on Reimport, in Unity 2021.3.9f1.
     
  30. Annett

    Annett

    Joined:
    Jan 14, 2019
    Posts:
    1
    Just had this issue as well, is there any fix or do I have to delete and remake?
     
  31. stroibot

    stroibot

    Joined:
    Feb 15, 2017
    Posts:
    92
    Oh yeah, I also have this 2022.1.17
     
  32. iamarugin

    iamarugin

    Joined:
    Dec 17, 2014
    Posts:
    887
    Unity 2021.3.16 constantly getting this when reimporting blend files.
     
  33. ysalpha

    ysalpha

    Joined:
    Feb 2, 2017
    Posts:
    52
    I get the following warning in my environment(Windows Unity 2021.3.18f1)
    "Importer(TextScriptImporter) generated inconsistent result for asset"

    Please be more specific about what information is used to obtain the guid, and what changes will cause the guid to change.
    Are CreationTime, LastWriteTime, LastAccessTime, etc. of the file used as well as the file path?

    What is written below is too abstract
    https://docs.unity3d.com/Manual/ImporterConsistency.html
    It does not help to solve the problem of why the guid has changed.
     
  34. Pharan

    Pharan

    Joined:
    Oct 28, 2013
    Posts:
    102
    I'm running into these warnings in Unity 2022.2.8

    It only started appearing AFTER I used the right-click > Reimport option, which I did because some scripts weren't compiling/Unity wasn't recognizing some of them as MonoBehaviours after moving them to different folders.

    The Reimport option seems to have fixed the MonoBehaviour issue but now it just keeps giving me the warnings at runtime. For example:

    Importer(DefaultImporter) generated inconsistent result for asset(guid:97aba4f7524399e4795d2cecbb1c7efb) "Assets/Scripts/Foundation/Pickup"


    I tried more recent versions but they were a little too crashy to continue developing in so I rolled back to the last known non-crashy one.
     
    xucian likes this.
  35. unity-18

    unity-18

    Joined:
    Jun 25, 2023
    Posts:
    1
    This bug is still in Unity version: 2022.3.1f1 (Android platform)
    I test that windows platform is correct at the same Unity version.

    The BUG is: "Reimport" and "Reimport All" has generated inconsistent result.

    The worst problem is that if you use the AssetBundle system, the inconsistent result will lead to different bundle file. (Generate md5 use the bundle file content)

    THE ONLY WAY I FOUND TO AVOID BUNDLE UNEXPECTED CHANGE:
    Every time to build the AssetBundle, you can reimport all assets in the project.
     
  36. NotEvenTrying

    NotEvenTrying

    Joined:
    May 17, 2017
    Posts:
    43
    Wanted to add my own experience as well - after reinstalling windows on my desktop and pulling the same project (.meta files included) from my git repo, I get inconsistent results between Reimport and Reimport All, particularly for .blend files, but also for some shaders. Reimport All seems to not help and broken things are still broken, while Reimport on individual files one by one seems to assign a new guid and fix it. Not exactly very fun to do when you have a lot of blender files... Unity version is 2021.2.7f1
     
    xucian likes this.
  37. hamza_unity995

    hamza_unity995

    Joined:
    Apr 19, 2022
    Posts:
    8
    hello we have exactly the same issue but the ReImport All solution did not fix it.
    we are using 2022.2.2f1.
    can you tell us more what you did? are you using addressables for a live game?
    thanks a lot for sharing this and for your help!