Search Unity

Opening file failed error

Discussion in 'Editor & General Support' started by Muzzn, Jun 12, 2011.

  1. Muzzn

    Muzzn

    Joined:
    Jan 23, 2011
    Posts:
    406
    Whenever I load Unity, or in fact do anything in it, I am presented with the following error message.
    "Opening File Library/FailedAssetsImports.txt failed:
    Access is denied"
    Has anyone else had this problem, and knows what to do about it?
     
  2. andeeeee

    andeeeee

    Joined:
    Jul 19, 2005
    Posts:
    8,768
    If this is happening on a Windows machine then the problem is possibly being caused by antivirus software (in which case, try disabling scanning for your Unity project folder and the app folder). If this is happening on a Mac... well, we've only ever had one report of this happening before and the bug was not reproducible. We'd love to have a bug report about this if you are indeed using a Mac, especially if you would be willing to do a bit of a follow up with the QA team.
     
  3. Muzzn

    Muzzn

    Joined:
    Jan 23, 2011
    Posts:
    406
    Using a Windows, so I'll try that.
    Thanks! Worked perfectly!
     
    Last edited: Jun 13, 2011
  4. yuriki

    yuriki

    Joined:
    Jun 19, 2013
    Posts:
    7
    Thank you! It's help to me too.
    P.S. Win7, Anti-virus Nod32
     
  5. TheWarper

    TheWarper

    Joined:
    Nov 3, 2013
    Posts:
    112
    Is this your problem?



    It seems that having the project folder shared via Dropbox and switching from mac to pc causes this problem which forces you to click "Try Again" many times before the project can be loaded.

    One solution is to automate the "Try Again" click with C# pinvoke code.



    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Runtime.InteropServices;
    using System.Text;
    using System.Threading;
    using System.Threading.Tasks;
    using System.Windows.Forms;

    namespace WindowsFormsApplication1
    {
    public partial class Form1 : Form
    {
    [DllImport("user32.dll", CharSet = CharSet.Auto)]
    static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, IntPtr wParam, IntPtr lParam);

    public const int BM_CLICK = 0x00F5;

    [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
    static extern IntPtr FindWindowEx(IntPtr hwndParent, IntPtr hwndChildAfter, string lpszClass, string lpszWindow);

    const UInt32 WM_CLOSE = 0x0010;

    public Form1()
    {
    InitializeComponent();
    System.Threading.Timer t = new System.Threading.Timer(new System.Threading.TimerCallback(killTryAgainsFCN));
    t.Change(1000, 500);
    }

    void killTryAgainsFCN(Object state)
    {
    IntPtr ButtonHandle = new IntPtr(0);

    System.Diagnostics.Process[] processes = System.Diagnostics.Process.GetProcessesByName("Unity");

    foreach (System.Diagnostics.Process p in processes) //should just be one process in this array
    {
    ButtonHandle = FindWindowEx(p.MainWindowHandle, IntPtr.Zero, null, "Try Again");

    if (ButtonHandle != IntPtr.Zero)
    {
    SendMessage(ButtonHandle, BM_CLICK, IntPtr.Zero, IntPtr.Zero);
    }
    }
    }
    }
    }

    $UnityOpeningFileFailed.png
     
    Last edited: Feb 28, 2014
  6. TheWarper

    TheWarper

    Joined:
    Nov 3, 2013
    Posts:
    112
    And here is a new and improved version to handle the internal Dropbox issue $UnityDropboxError.png

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Runtime.InteropServices;
    using System.Text;
    using System.Threading;
    using System.Threading.Tasks;
    using System.Windows.Forms;

    namespace WindowsFormsApplication1
    {
    public partial class Form1 : Form
    {
    [DllImport("user32.dll", CharSet = CharSet.Auto)]
    static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, IntPtr wParam, IntPtr lParam);

    public const int BM_CLICK = 0x00F5;

    [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
    static extern IntPtr FindWindowEx(IntPtr hwndParent, IntPtr hwndChildAfter, string lpszClass, string lpszWindow);

    // Find window by Caption only. Note you must pass IntPtr.Zero as the first parameter.

    [DllImport("user32.dll", EntryPoint = "FindWindow", SetLastError = true)]
    static extern IntPtr FindWindowByCaption(IntPtr ZeroOnly, string lpWindowName);

    [DllImport("user32.dll", SetLastError = true)]
    static extern IntPtr FindWindow(string lpClassName, string lpWindowName);

    public delegate bool EnumChildCallback(IntPtr hwnd, ref IntPtr lParam);

    [DllImport("user32.dll")]
    public static extern int EnumChildWindows(IntPtr hwnd, EnumChildCallback Proc, int lParam);

    const UInt32 WM_CLOSE = 0x0010;

    public Form1()
    {
    InitializeComponent();
    System.Threading.Timer t = new System.Threading.Timer(new System.Threading.TimerCallback(killTryAgainsFCN));
    t.Change(1000, 500);
    }

    public bool EnumChildProc(IntPtr hwndChild, ref IntPtr lParam)
    {
    //SendMessage(hwndChild.ToInt32(), WM_SETTEXT, 0, textBox1.Text);
    IntPtr ButtonHandle = FindWindowEx(hwndChild, IntPtr.Zero, null, "Try Again");

    if (ButtonHandle != IntPtr.Zero)
    {
    SendMessage(ButtonHandle, BM_CLICK, IntPtr.Zero, IntPtr.Zero);
    }
    return true;
    }

    void killTryAgainsFCN(Object state)
    {
    IntPtr handle = IntPtr.Zero;
    EnumChildWindows(handle, EnumChildProc, 0);
    }
    }
    }
     
    EiknarF likes this.
  7. DougMcFarlane

    DougMcFarlane

    Joined:
    Apr 25, 2009
    Posts:
    197
    @TheWarper - I like your solution. It is the only one in that would work for me - as Dropbox is causing my problems. If I disable Dropbox scanning, then I don't get these errors. I haven't actually tried yours yet. I haven't gotten that desperate yet, to run another program in the background doing the clicking for me. Close though!

    The *best* solution if for UNITY to implement an automatic 'Retry' every second or so. Make it an option. I have to babysit opening a project - it takes a minute or so of clicking 'Retry' each time I switch computers.
     
  8. cbonsi

    cbonsi

    Joined:
    Jun 24, 2019
    Posts:
    1
    i've already exclude the project folder and the app folder in my antivirus, also tried deleting the library folder. not using dropbox neither sharing my project with other machines. i'm on the clock, please help!?

    using windows 10
    it hapenned after i switched the GI Cache folder location, and changed a feel thing in may GPU panel control. thingking is related to that.