Android Studio: Invalid file descriptor?

Ne
5

I started a project in Android Studio on my Windows 10 laptop.

Now I wanted to continue working on it on my Linux Mint machine. That's why I dragged the project onto the NAS to work with both devices.

Everything works perfectly on the Windows 10 laptop.

But with Android Studio on Linux, when I try to run the app on my phone, I get the error message:

invalid file descriptor

What went wrong: Failed to release lock on file hash cache (/home/johannes/Code/Penguin/.gradle/5.4.1/fileHashes)> Invalid file descriptor

-

To rule out errors, I created a completely new project on the PC. As expected, the same error message still appears.

My phone is correctly recognized by the PC and USB debugging is activated.

In Android Studio, my phone is automatically selected to run the app. However, the Connection Assistant says that no device was recognized. I find it strange, since my cell phone is displayed to run the app.

To rule out this error, I wanted to run the app on a virtual device. I built my SM J320F with Android 5.1.1 and used the Google Pixel 3 with Android 9 and 10.

The same error message always remains.

I don't find anything on the Internet about this mistake, which apparently nobody but me has.

Can someone help me? With the error message I can't do anything with my lay knowledge.

Le

I would end all Java processes (a restart of the computer will do the same) and then look for the locked files (* .lock) in the .gradle directory. These should be deleted. If that doesn't work, you can proceed step by step: First delete / rename the .gradle / caches folder, otherwise the entire directory.

Ne

Okay thanks. I will try that. I have restarted my PC a thousand times. I don't think it's because of Java processes because Intellij works perfectly. Or am I wrong about it?

Le

That would be relevant in the event that processes block each other. For example. A second Android Studio instance that accesses the Gradle files.

Why are you talking about IntelliJ now? While it doesn't change my answer above, it's still a bit confusing.

Ne

Forget about Intellij, that was a rough workaround.l

Ne

I deleted all .lock files as well as the complete .gradle folder. The problem is that all .lock files are automatically created again. That Deleting does not work because they reappear when compiling…