"Cannot access the file ..." error message for every library on every build

Every time I build, I get the “Oops. It seems Water is experiencing a problem” dialog once for every library I have linked in my project (so, about 10 times). This seems to occur most often when I let my computer sleep/suspend while Water is running, but I’m not sure that is always the case. I tried deleting the entire EBuild\Obj folder but surprisingly it didn’t fix the problem.

**The process cannot access the file 'C:\Users\mattr\AppData\Local\RemObjects Software\EBuild\Obj\com.accordancebible.Accordance-41B2B528C95FF8894A8BBC595F2F5321251E4FEE\Debug\Cooper-Android\r\androidx\navigation\R.java' because it is being used by another process.**
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at RemObjects.Elements.RTL.FileHandle.$New(String FileName, FileOpenMode Mode)
at RemObjects.Elements.RTL.File.ReadBinary(String aFileName)
at RemObjects.Fire.ProjectSystem.FileBuffer.loadContentWithUsedEncoding____date(Encoding& encoding, DateTime& changedDate)
at RemObjects.Fire.BaseLibrary.FBLFileBuffer.reloadContents()
at RemObjects.Fire.ProjectSystem.FileBuffer.<reloadContentsFromDisk>b__1()
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

Curious. I’m guessing what’s happening is that somehow Water is reacting of the file change “to quickly” and tries to reload the file while it’s still being written by the build. I will see what I can do to mitigate.

Is this new for you, or has this always happened? Any Android project, or just a specific one?

thanx,
marc

Thanks, logged as bugs://83316

It hasn’t always happened, but has happened occasionally for a few months I would say. But it’s just been the past couple of weeks where it happens with every single build.

I only have one Elements project that I work on, so I’ll have to create some test projects to see.

Odd. nothing changed that should make this. ore likely to trigger now. but I’ve added some code to hopefully handle the for the next build; I’ll try to get you an interim build today.

—marc

I just had a case where I built and did not get this error. It happens again afterward now, but that behavior makes it seem like your guess was correct.

1 Like

Let me know if tomorrow’s build solves this.

1 Like

So far so good on .2443. I do seem to get this error on every build now though, not sure if it’s related:

Object reference not set to an instance of an object.
at RemObjects.Elements.RTL.ImmutableDictionary`2.GetValues__$mapped(Dictionary`2 self)
at RemObjects.Fire.ProjectSystem.Solution.fileWithURL(Url url)
at RemObjects.Fire.ProjectSystem.LineNode.findOrCreateNodeForURL(Url url)
at RemObjects.Fire.App.TreeController.syncOutlineViewToNode(Node node)
at RemObjects.Fire.App.RecentsTreeController.recheckFiles(RecentsNode upToBucket)
at RemObjects.Fire.App.RecentsTreeController.recheckTimes()
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

Actually the new error message does not seem strictly related to the build. It just happens every 45-60 second,s even when Water is idle.

Curious. Any project, or just this one? Is then the full callstack? (fwiw, it doesn’t seem related, no)

Any project. Any Android project at least, as that’s all I’ve had open. Oddly though, it seems suddenly to have stopped happening. Not sure what happened to trigger that. I’ll update if I see it again.

Not sure I understand what you’re asking here

sorry, that was meant to be “Is that the full callstack?”

Ah, yes that’s the full callstack

Really weird; im expecting the code now, and I’m having a really hard time seeing how this could NRE, unless the Recents view was somehow kept around for a solution that was closed

Was closing a solution and keeping the Water instance open (or opening a new solution in the same instance) involved in this?

It definitely could have been. I did open/close multiple solutions while keeping the Water instance open. I also believe that at one point I accidentally terminated Water and re-opened it. So that could have been when the error messages stopped.

Ok. I could not repro the issue as such, but I’ll add some preventive nil proofing there. Could be a corner case “retain cycle” (which I know isn’t a thing in .NET) where something kept the Solution object and the timer that updates the Recents view around, even after the solution got “closed” (which frees a lot if its content, including the dictionary that this NRE tries to access)…

bugs://83316 got closed with status fixed.