URGENT! I can't build with Unity
Hi,
I was trying to get my Game Music to work when I stumbled on an Unity Error with the File (Editor) (Build: Windows x86_64)
Please help me ASAP!
Answer by oStaiko · Feb 07, 2017 at 06:13 AM
I had a similar issue before. When working with a partner from a different timezone, they sent files that to my computer, appeared to be 2 hours from the future. For some odd reason Unity cannot build with assets from the future. Unfortunately, you might just have to wait a few hours until it passes like I did! Other than than, edit the files to reset the date, or change your computers time? Goodluck
Hey, the thing is I didn't even tough them. I just copied them to my laptop then when I went back to my desktop it sent that error
Still got the same problem and I tried what you said
Here, try this script, it might help refresh the dlls. Put it in an Editor folder, and then run the menu item "Assets/Reimport UI Assemblies" after the error appears again.
using UnityEngine;
using System.Collections.Generic;
using UnityEditor;
using System.Text.RegularExpressions;
using System.IO;
using System.Text;
public class ReimportUnityEngineUI
{
[$$anonymous$$enuItem( "Assets/Reimport UI Assemblies", false, 100 )]
public static void ReimportUI()
{
#if UNITY_4_6
var path = EditorApplication.applicationContentsPath + "/UnityExtensions/Unity/GUISystem/{0}/{1}";
var version = Regex.$$anonymous$$atch( Application.unityVersion,@"^[0-9]+\.[0-9]+\.[0-9]+").Value;
#else
var path = EditorApplication.applicationContentsPath + "/UnityExtensions/Unity/GUISystem/{1}";
var version = string.Empty;
#endif
string engineDll = string.Format( path, version, "UnityEngine.UI.dll");
string editorDll = string.Format( path, version, "Editor/UnityEditor.UI.dll");
ReimportDll( engineDll );
ReimportDll( editorDll );
}
static void ReimportDll(string path )
{
if ( File.Exists( path ) )
AssetDatabase.ImportAsset( path, ImportAssetOptions.ForceUpdate| ImportAssetOptions.DontDownloadFromCacheServer );
else
Debug.LogError( string.Format( "DLL not found {0}", path ) );
}
}
Credits to j-robichaud for the script, but it was written for Unity 4.6, so I don't really know if it still works. If it doesn't, you'll have to try the reimport all assets option, or maybe just delete your whole library folder (get a backup first) and let it make a new one.