IDE2 Bit Upset Need Help

Hello,
Been getting on really well with IDE 2 but this evening it is being troublesome.
(1) I keep a backup disk of my sketches (folder copy) and I accidentally clicked on the backup ino file and now I have two projects of same name in my Open Recent list. (My Bad)

(2) Project I am currently has an ino and four other .cpp and five .h files.
I wanted to change the name of one the .cpp and .h to something different.
So I created the new file/names in the sketch, copy/pasted the files content from org file to new file, saved the sketch, than selected and deleted the org .cpp and .h.

Now when I try to build I get multiple declarations of functions and variables as IDE2 seems to be finding the org deleted files and/or there function/variable names which are in fact gone!

So I guess IDE2 has some cache hidden away somewhere; where is it and can I just delete it to clear all my projects and fresh start please?
Many thanks imk

You don't mention which operating system you're using. For Windows

  1. I think (!) that the cache is here: C:\Users\yourUsername\AppData\Local\Temp\arduino
  2. For the recent sketches, look in C:\Users\yourUsername\.arduinoIDE

Hi @imk123

You can clear the File > Open Recent menu by deleting the file at this path:

Windows

C:\Users\<username>\.arduinoIDE\recent-sketches.json

(where <username> is your Windows username)

Linux

~/.arduinoIDE/recent-sketches.json

macOS

~/.arduinoIDE/recent-sketches.json

Or you can even open the file in a text editor and modify it if you want to preserve some of the current menu contents.

This bug is being tracked by the Arduino developers here:

My recommendation is to do a surgical deletion only of the temporary build folder for the sketch rather than clearing the cache entirely. The reason is that the cache of compiled cores speeds up compilation significantly and if you clear everything then you are going to have to wait for a fresh core compilation the next time you compile for each given board.

We can extract the temporary build folder for the sketch from the verbose output so I'm going to ask you to share that output:

Please do this:

  1. Open the troubled sketch in Arduino IDE.
  2. Select File > Preferences from the Arduino IDE menus.
  3. Check the box next to "Show verbose output during: ☐ compilation".
  4. Click the OK button.
  5. Select Sketch > Verify/Compile from the Arduino IDE menus.
  6. Wait for the compilation to fail.
  7. You will see a "Compilation error: ..." notification at the bottom right corner of the Arduino IDE window. Click the COPY ERROR MESSAGES button on that notification.
  8. Open a forum reply here by clicking the Reply button.
  9. Click the <CODE/> icon on the post composer toolbar.
    This will add the forum's code block markup (```) to your reply to make sure the error messages are correctly formatted.
    Code tags icon on toolbar
  10. Press Ctrl+V.
    This will paste the compilation output into the code block.
  11. Move the cursor outside of the code tags before you add any additional text to your reply.
  12. Click the Reply button to post the output.

In case the output is longer than the forum software will allow to be added to a post, you can instead save it to a .txt file and then attach that file to a reply here:

  1. Open any text editor program.
  2. Paste the copied output into the text editor.
  3. Save the file in .txt format.
  4. Open a forum reply here by clicking the Reply button.
  5. Click the "Upload" icon (Upload icon) on the post composer toolbar:
    Upload icon on toolbar
  6. Select the .txt file you saved.
  7. Click the Open button.
  8. Click the Reply button to publish the post.

Alternatively, instead of using the "Upload" icon on the post composer toolbar as described in steps (5) - (7) above, you can simply drag and drop the .txt file onto the post composer field to attach it.

Hello All and many thanks for the replies.
OS is Win10 forgot to mention My Bad, tried Win 11 is Five Star Rubbish!
All sorted now many thanks again imk
PS This has to be best Forum on the web

You are welcome. I'm glad it is working now.

Regards,
Per

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