Search Unity

UnityEngine.UI.dll is in timestamps but is not known in assetdatabase

Discussion in 'Asset Database' started by iivo_k, Oct 17, 2014.

  1. iivo_k

    iivo_k

    Joined:
    Jan 28, 2013
    Posts:
    314
    I'm using beta 19 on Windows and still quite constantly get the error "Asset 'C:/Program Files (x86)/Unity/Editor/Data/UnityExtensions/Unity/GUISystem/4.6.0/UnityEngine.UI.dll' is in timestamps but is not known in assetdatabase..." despite the patch notes saying it should be fixed.

    What usually happens is I try to quit Unity by pressing the close button (X) and nothing seems to happen. I press it again after a while and Unity closes. I start the project again and it's messed up, gives me this error. The uGUI elements already added to a scene still work, but I can't add any new uGUI components. I have to delete the library and reimport everything (which takes a long time with our project).
     
    himerlandest likes this.
  2. phil-Unity

    phil-Unity

    Unity UI Lead Developer

    Joined:
    Nov 23, 2012
    Posts:
    1,226
    Does it happen with b20? i know it might not be usable for you atm but maybe it has been fixed there. The other option is to wait for b21. if it still happens in b21 report a bug.
     
    himerlandest likes this.
  3. tosiabunio

    tosiabunio

    Joined:
    Jun 29, 2010
    Posts:
    115
    It has just happened in b20.
     
  4. j-robichaud

    j-robichaud

    Joined:
    Aug 26, 2010
    Posts:
    40
    We had this issue a few times in b20, haven't tried with b21.

    Saving a scene with Unity in this state will create "Missing Script" issues on all uGUI components.
     
    GabLeRoux likes this.
  5. iivo_k

    iivo_k

    Joined:
    Jan 28, 2013
    Posts:
    314
    Just had this happen in 4.6 RC1.

    Edit: I was opening an older copy of the project and Unity seemed to hang, just showing the splash logo. Killed the process, opened the newest copy, missing uGUI stuff.
     
  6. iivo_k

    iivo_k

    Joined:
    Jan 28, 2013
    Posts:
    314
    Just happened with RC3. I quit Unity, re-installed Visual Studio Tools for Unity, reopened Unity and bam.
    It's getting quite annoying to have to delete the Library folder and going through the import that takes ages with our project.

    I reported a bug, 649844.
     
  7. iivo_k

    iivo_k

    Joined:
    Jan 28, 2013
    Posts:
    314
    I've gotten this at least three times today. Also, during the import Unity keeps stopping the process to tell it couldn't open some temp file, which is always fixed with "try again". So I can't even go do something else during the import.
     
  8. Gizmoi

    Gizmoi

    Joined:
    Jan 9, 2013
    Posts:
    327
    My team has been encountering this issue since b17, with no reliable way of reproducing.

    A colleague of mine seems to have narrowed it down to when Unity crashes or quits unexpectedly during compilation.
     
  9. brendan-vance

    brendan-vance

    Joined:
    Jan 16, 2014
    Posts:
    36
    We're on 4.6.0 now and this problem has only become more frequent. I'm having difficulty tracking it down, but one interesting thing about it is the way it propagates through our PlasticSCM branches (i.e. once it occurs on one branch and we then merge that onto another, everyone using this other branch experiences it in turn). Mysterious.
     
  10. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,225
    I'd like to get a solid repro case for this, if you can find / hunt one down please let me know. :)
     
  11. brendan-vance

    brendan-vance

    Joined:
    Jan 16, 2014
    Posts:
    36
    I'm keeping my eyes open. In the meantime, do you suppose I could just compile my own UnityEngine.UI.dll and UnityEditor.UI.dll files and dump them into our assets folder? Those will supersede the UnityExtensions stuff, yes?
     
  12. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,225
    They won't currently (probably), it's on our roadmap.
     
  13. jyves69

    jyves69

    Joined:
    Jan 3, 2014
    Posts:
    9
    We usually have the problem 3,4 times per day (with 10 developpers). The only solution that works is to rebuild the library folder but it takes hours on our projects. It's just a nightmare !
    We tried with unity 4.6.1 and the issue is still there.
    Do you have you any tips unity guys ?
     
  14. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,225
    We don't have a good repro and know whats causing it (We have only seen it once or twice seen it internally). We wan't to fix this but are not sure why it's happening yet.
     
  15. maciej-struzyna

    maciej-struzyna

    Joined:
    Aug 10, 2012
    Posts:
    6
    Just had it 10 times in 20 people team in one day. No idea what causes it but once it started it randomly occures on all machines. I personaly had it when resizing a png on disk from 100 to 256 pixels and than switching back to unity window.

    Unity, please let us know how we could help you to fix the problem :)
     
  16. phil-Unity

    phil-Unity

    Unity UI Lead Developer

    Joined:
    Nov 23, 2012
    Posts:
    1,226
    I'd guess over the team something got checked in which caused the issue, could you send us the project when its in that state? Hopefully it would then happen for us as well :).
     
  17. iivo_k

    iivo_k

    Joined:
    Jan 28, 2013
    Posts:
    314
    We have several projects that use a symlinked shared folder that contains most of the code and resources. Most often this seems to happen when switching between projects and there's some reimporting to do.

    Just now I was happily doing stuff with a project, then created a new bug repro project and changed to that. When I changed back to the project, it happened again. I did nothing except changed projects. It's only the UnityEditor.UI.dll and UnityEngine.UI.dll that can't recover from it after a restart.

    Here's a picture of the console on the first start when it broke and after a restart.

    Timestamps.jpg
     
  18. mikaelwallin

    mikaelwallin

    Joined:
    Dec 11, 2013
    Posts:
    20
    Still happens. Unity 4.6.1 p2
     
  19. sergih123

    sergih123

    Joined:
    Jan 18, 2015
    Posts:
    1
    Happening to me too, I've got a 32bit version of this program and I'm using a 64bit version of windows...does that matter?
    This is the first time I launch the program, I choosed the folder where create the game and it stays loading the whole time.
     
  20. SunstormJared

    SunstormJared

    Joined:
    Jan 30, 2013
    Posts:
    4
    So - I ran into this problem, and I tried all the suggestions of re-importing my project, deleting the Library Folder, all to no avail. It seemed that everytime I opened my project it would crash Unity 4.6.1. I even tried a clean install of Unity 4.6.1 and it still crashed. So I went to the console (Mac OS X) and found that it had problems re-importing one of my assets. A material file of all things.

    Updating Assets/ArbitraryMaterialNameWhichWasIrrelevant.mat - GUID: 4bb4b66abacc57b44a075bdef8051b4b...
    libc++abi.dylib: terminating with uncaught exception of type std::length_error: basic_string::resize

    It then had a pretty stacktrace which means nothing to me, but perhaps to Unity Devs....

    (attached Stacktrace.txt)

    So, Everytime I would re-open my project after this (in the few occurrences that I could) none of the UI solution would work, because the guidmapper didn't have a reference to any of those scripts / components. Because the project import errored out, and never completed cleanly / successfully. So the very simple task of deleting the offending corrupted material, and re-importing my project has allowed it to re-import correctly, and then all the UI components work again. So my recommendation to users is to try and see what the last asset was that was GUID mapped, and ensure there weren't errors importing your project. If there are, remove the offending files, and re-import... Worst case is you have to rebuild a corrupted asset or two. Hopefully it's a material file or something arbitrary.
     

    Attached Files:

  21. Jde

    Jde

    Joined:
    Oct 2, 2011
    Posts:
    139
    I started getting this after doing a build and getting this error...

    That happened because I built to a location outside of my project folder (http://forum.unity3d.com/threads/un...d-when-compiling-for-ios.285063/#post-1885140). I had to reinstall Unity after that. Ever since then I've had the UnityEngine.UI.dll timestamps error.

    I just deleted my library folder though and the timestamps error has disappeared.
     
  22. Gizmoi

    Gizmoi

    Joined:
    Jan 9, 2013
    Posts:
    327
    Haven't had this issue since moving to 5 beta, never had a reliable repro though so I'm not sure it's fixed/
     
  23. j-robichaud

    j-robichaud

    Joined:
    Aug 26, 2010
    Posts:
    40
    I made a script that appears to fix the issue when it happens.

    What the script does is like right-clicking on an asset and select "Reimport". Since the UI assemblies are not in the Assets folder it cannot be done manually, it has to be done from script.

    Import this C# script in an Editor folder and then run the menu item "Assets/Reimport UI Assemblies" when the timestamp error appears.

    This way you do not need to reimport all the project.

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections.Generic;
    3. using UnityEditor;
    4. using System.Text.RegularExpressions;
    5. using System.IO;
    6. using System.Text;
    7.  
    8. public class ReimportUnityEngineUI
    9. {
    10.     [MenuItem( "Assets/Reimport UI Assemblies", false, 100 )]
    11.     public static void ReimportUI()
    12.     {
    13. #if UNITY_4_6
    14.         var path = EditorApplication.applicationContentsPath + "/UnityExtensions/Unity/GUISystem/{0}/{1}";
    15.         var version = Regex.Match( Application.unityVersion,@"^[0-9]+\.[0-9]+\.[0-9]+").Value;
    16. #else
    17.         var path = EditorApplication.applicationContentsPath + "/UnityExtensions/Unity/GUISystem/{1}";
    18.         var version = string.Empty;
    19. #endif
    20.         string engineDll = string.Format( path, version, "UnityEngine.UI.dll");
    21.         string editorDll = string.Format( path, version, "Editor/UnityEditor.UI.dll");
    22.         ReimportDll( engineDll );
    23.         ReimportDll( editorDll );
    24.                
    25.     }
    26.     static void ReimportDll(string path )
    27.     {
    28.         if ( File.Exists( path ) )
    29.             AssetDatabase.ImportAsset( path, ImportAssetOptions.ForceUpdate| ImportAssetOptions.DontDownloadFromCacheServer );
    30.         else
    31.             Debug.LogError( string.Format( "DLL not found {0}", path ) );
    32.     }
    33. }
    34.  
     
    Last edited: Mar 12, 2015
  24. Megamike55

    Megamike55

    Joined:
    Sep 3, 2012
    Posts:
    4
    I just want to thank you, j.robichaud, for the script you wrote. It worked perfectly! Thank you, you've saved me.
     
  25. Issam

    Issam

    Joined:
    Dec 18, 2012
    Posts:
    37
    Thanks for this, my co-worker was getting that error after a crash today and this fixed it.
     
  26. DrivingSim

    DrivingSim

    Joined:
    May 28, 2013
    Posts:
    32
    Thanks j.robichaud, great script. Worked for me.
     
  27. iGhost2015

    iGhost2015

    Joined:
    Feb 12, 2015
    Posts:
    8
    I guess this is the reason. the UI assembly is not under version control. uGUIErrorScreenShot.jpg
     
  28. thempus

    thempus

    Joined:
    Jul 3, 2010
    Posts:
    61
    I got the same random error, now a lot of default sprites are missing! This is really bad.
     
  29. PavanHolkar

    PavanHolkar

    Joined:
    Sep 26, 2012
    Posts:
    15
  30. Shahdee

    Shahdee

    Joined:
    Jul 1, 2012
    Posts:
    8
    Thank you very much j.robichaud. I had a lot of missing ui scripts in my game windows and your script really helped me to restore everything in several seconds. You saved my week! :)
     
  31. DenisM

    DenisM

    Joined:
    Dec 6, 2013
    Posts:
    62
  32. Gizmoi

    Gizmoi

    Joined:
    Jan 9, 2013
    Posts:
    327
    Looks like they changed the folder structure somewhere leading upto RC3, this no longer works for me.
    I get the error:

    Code (csharp):
    1. DLL not found C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/GUISystem/5.0.0/UnityEngine.UI.dll
     
    Gua likes this.
  33. Gua

    Gua

    Joined:
    Oct 29, 2012
    Posts:
    455
    Same here
     
  34. j-robichaud

    j-robichaud

    Joined:
    Aug 26, 2010
    Posts:
    40
    I tried to fix the script but Unity changed how "AssetDatabase.ImportAsset" works in Unity 5.

    My workaround is no longer valid in Unity5.

    It gives the following warning:
    '/Applications/Unity 5.0.0f3/Unity.app/Contents/UnityExtensions/Unity/GUISystem/Editor/UnityEditor.UI.dll' is an absolute path, importing is skipped
    Paths to assets have to be relative to the project folder e.g 'Assets/Folder/MyAsset.asset'
     
  35. geroppo

    geroppo

    Joined:
    Dec 24, 2012
    Posts:
    140
    is there any solution to this in unity 5 ?
     
  36. mark_madatom

    mark_madatom

    Joined:
    Sep 29, 2014
    Posts:
    2
    This is still broken in 5.0.0f4 (i.e. the final shipping version of 5). Come on Unity - sort it out!
     
  37. geroppo

    geroppo

    Joined:
    Dec 24, 2012
    Posts:
    140
    we were evaluating upgrading to unity 5, but if there isn't any workaround like the great script that robichaud did, we can't risk it, since we already got this problem on 4.6 and thank god we got that script to fix it.
     
  38. j-robichaud

    j-robichaud

    Joined:
    Aug 26, 2010
    Posts:
    40
    I filled a bug report to Unity and they said they were able to reproduce the fact we can no longer reimport UI Assemblies. They sent it to developers. I hope they will fix this soon.

    Here's an updated version of the script compatible with Unity 4.6 and Unity 5 (when they will fix the reimport issue on their side it should work again)

    I suggest you to upgrade the script and try with every new versions of Unity 5.

    There is nothing else I can do for now.

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections.Generic;
    3. using UnityEditor;
    4. using System.Text.RegularExpressions;
    5. using System.IO;
    6. using System.Text;
    7.  
    8. public class ReimportUnityEngineUI
    9. {
    10.     [MenuItem( "Assets/Reimport UI Assemblies", false, 100 )]
    11.     public static void ReimportUI()
    12.     {
    13. #if UNITY_4_6
    14.         var path = EditorApplication.applicationContentsPath + "/UnityExtensions/Unity/GUISystem/{0}/{1}";
    15.         var version = Regex.Match( Application.unityVersion,@"^[0-9]+\.[0-9]+\.[0-9]+").Value;
    16. #else
    17.         var path = EditorApplication.applicationContentsPath + "/UnityExtensions/Unity/GUISystem/{1}";
    18.         var version = string.Empty;
    19. #endif
    20.         string engineDll = string.Format( path, version, "UnityEngine.UI.dll");
    21.         string editorDll = string.Format( path, version, "Editor/UnityEditor.UI.dll");
    22.         ReimportDll( engineDll );
    23.         ReimportDll( editorDll );
    24.                
    25.     }
    26.     static void ReimportDll(string path )
    27.     {
    28.         if ( File.Exists( path ) )
    29.             AssetDatabase.ImportAsset( path, ImportAssetOptions.ForceUpdate| ImportAssetOptions.DontDownloadFromCacheServer );
    30.         else
    31.             Debug.LogError( string.Format( "DLL not found {0}", path ) );
    32.     }
    33. }
    34.  
     
    GabLeRoux, MiloBu and pahe like this.
  39. arinu3d

    arinu3d

    Joined:
    Mar 11, 2015
    Posts:
    1
  40. j-robichaud

    j-robichaud

    Joined:
    Aug 26, 2010
    Posts:
    40
    I may have found a workaround. The idea is to totally remove the UI System from Unity then put it back. Unity should reload its modules.

    I wrote a full walktrough but overall it is very simple. It is better than a full reimport.
    1. Remove the UI System
      1. Close Unity
      2. Access on Unity's installation folder on Explorer or Finder on mac (On mac rightclick on the App and click on ShowPackageContent).
      3. Locate the folder named "UnityExtensions/Unity". (On Mac: "Content/UnityExtensions/Unity".
      4. In this folder you will notice a folder named "GUISystem"
      5. Move this folder from the installation folder (you may need administrator rights). Yes, right. Do not just rename it or move it out the "Unity" folder, Unity will find it... I assure you...
    2. Have Unity notice the change
      1. Open Unity again in the project you had the issue
      2. You may have an error "GameObject (named 'Canvas') references runtime script in scene file. Fixing!"
      3. Close Unity, DO NO SAVE ANY SCENE
    3. Restore the UI System
      1. Make sure Unity is closed
      2. Restore the "GUISystem" to its previous location
      3. Open Unity again
      4. Unity will compile script
      5. You will see the warning "Timestamps (19) and assets (21) maps out of sync." and the errors "Asset '' is in assets but has no assettimestamp..." just ignore them
      6. Everything should be ok again
     
    Phuzz, Orrib, doggan and 13 others like this.
  41. geroppo

    geroppo

    Joined:
    Dec 24, 2012
    Posts:
    140
    thanks, finally i will be able to try unity 5 without fear
     
  42. hoesterey

    hoesterey

    Joined:
    Mar 19, 2010
    Posts:
    659
    This just happened to me too on all computers at the company. Using Unity 5. Tried everything above nothing is working. Uninstalled, and then re-installed the editor, no luck. Deleted the library and re-imported assets, no luck. Started a test project, no luck.
     
    Last edited: Mar 17, 2015
  43. hoesterey

    hoesterey

    Joined:
    Mar 19, 2010
    Posts:
    659
    Ok so installing the patch version of Unity released today got me going. Sadly copying in my own GUI code will break it again...this is new to something in Unity as the code has not been updated in source control for a month. Tracking this down.
     
  44. hoesterey

    hoesterey

    Joined:
    Mar 19, 2010
    Posts:
    659
    I can now get unity to load again.
    But regardless of what I do I'm getting the following error now when creating a "button" after I put any custom GUI code back into the extensions folder.
    MissingMethodException: Method not found: 'UnityEngine.Camera.get_pixelWidth'.
    UnityEditor.UI.MenuOptions.CreateUIElementRoot (System.String name, UnityEditor.MenuCommand menuCommand, Vector2 size)
    UnityEditor.UI.MenuOptions.AddButton (UnityEditor.MenuCommand menuCommand)

    Basically my custom GUI code modification just stopped working. No changes to that code I checked source control history. Any ideas?
     
  45. geroppo

    geroppo

    Joined:
    Dec 24, 2012
    Posts:
    140
    try sending a bug report, there's not much we can do :(
     
  46. codestage

    codestage

    Joined:
    Jul 27, 2012
    Posts:
    1,931
    Just had this issue on the latest Unity 5 patch release.
    Thanks, @j.robichaud, your solution with moving GUISystem folder worked for me.
     
  47. ABerlemont

    ABerlemont

    Joined:
    Sep 27, 2012
    Posts:
    67
    Thanks, @j.robichaud, your solution with moving GUISystem folder worked for me.​

    Same here. Thanks !

    Location for GUISystem folder is : C:\Program Files (x86)\Unity\Editor\Data\UnityExtensions\Unity\
     
  48. Bamboy

    Bamboy

    Joined:
    Sep 4, 2012
    Posts:
    64
    @j.robichaud's solution didn't seem to work for me. I found another one that does work...
    1. Close Unity,
    2. Delete the Library folder of the project you are having this issue with,
    3. Reopen Unity
    4. Profit
     
  49. j-robichaud

    j-robichaud

    Joined:
    Aug 26, 2010
    Posts:
    40
    The goal of the solution is to avoid reimporting the whole project which deleting the Library does. I'm sad my solutions did not work for you.
     
  50. tigertrussell

    tigertrussell

    Joined:
    Mar 29, 2013
    Posts:
    22
    This happened to me after screwing around with some source control stuff and moving folders/files around my project to make my repository smaller.

    I did this: Assets > Reimport All from the application menu and it fixed it for me.

    Unity 5