Compilation Error in Arduino-CLI - unable to rename 'core.a'; reason: File exists

I have an extremely frustrating error message that I am getting in Arduino-CLI only, see below. There are other posts on this specific "unable to rename" core.a file and many others have suggested ignoring Arduino under the anti virus settings, but my situation is slightly different. The sketch compiles just fine in Arduino and the error is only occurring in Arduino-cli. Hoping someone out there has seen this before

unable to rename 'C\Users**\AppsData\Local\Temp\arduino\sketches\5513632BBDAB7F9AA526EB784168385F\core\core.a'; reason: File exists

Your topic has been moved to the dedicated CLI section of the forum.

Did you try to manually delete the file? Does the problem come back after that?

You can safely delete anything in the directory ' C\Users**\AppsData\Local\Temp\arduino\sketches'; it's the cache. So I suggest that you delete the '5513632BBDAB7F9AA526EB784168385F' directory.

Note:
I'm not a CLI user.

Which board and version of it are you using?

Does the error happen every time?

What's the command-line to invoke arduino-cli?

Yes, I deleted the file, but it is created on the next compilation and the error occurs again.

This is a custom built board, but I am programming it using Arduino-ESP32 by Espressif Systems. The board I am using to compile the sketch is the ESP32 Wrover Module. It happens maybe 90% of the time. The command in arduino-cli is arduino-cli compile -b esp32:esp32:esp32wrover -v

I had this working on my computer a few months months ago and I was able to compile this sketch and upload it to about 20 different boards over the last year on and off. I think the most helpful piece to all of this is that it compiles in Arduino, but it does not compile in arduino-cli. Thanks for your help.

Arduino-ESP32 was updated to v3 about six weeks ago. If that's what you're using, maybe try reverting to the latest v2, 2.0.17. Or vice versa.

I'm still using 2.0.3. That was the latest version available when I developed this product.

Did you try it? If so, did the problem still occur after you did that?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.