IDE 2.1.0 has lost library examples

Hi There,
I recently migrated from 1.8.19 to 2.1.0 and the process was painless. It also picked up my additional devices and installed libraries for them, and has initiated one update since then.

Now I find that only the 'built-in examples' are present and that all the examples that came with the additional libraries are missing. The interesting thing is that the libraries themselves still exist as a sketch that depends on them will compile without complaint.

How do I restore the missing examples?

I took the library path as reported during the compile process and checked - yes, the examples folder is still present. They are just not presented in the Files->Examples tree, even after closing and restarting the IDE.

For what it is worth: I ran 1.8.19 and this IDE correctly lists all the extended examples so I conclude it is not something with the libraries themselves. Both versions of the IDE report the libraries to be in the same location, for example:
C:\Users\OEM\Documents\Arduino\libraries\Adafruit_SSD1306

Any suggestions or other observations around this issue?

Graham

1 Like

Hi @KiwiGraham. Please try this:

  1. Select File > New Sketch from the Arduino IDE menus.
  2. Wait for the new window to finish loading.
  3. Open the File > Examples menu in the new window.

Do you see the library examples in the menu?

There is a known bug in Arduino IDE 2.x that causes the File > Examples menu to not be populated with the library examples:

This fault occurs intermittently. At least for me, it is now very rare; maybe occurring once in every hundred times I open the menu. When it does occur, I find that it is fixed by opening a new IDE window. You can also restart the IDE altogether, but it is a little faster to open a new window instead. So if you are experiencing that specific bug, I would expect that it will no longer occur after you open the new window, and also that you won't be too often troubled by it.

1 Like

@KiwiGraham did this problem occur when the IDE was in the state you reported in your other topic?:

If so, the lack of the examples in the menu is another symptom of the IDE being in that bad state. The IDE application is split into two parts:

  • frontend
  • backend

The "frontend" is the GUI you interact with. The backend is what provides some of the data that is used to populate the GUI with dynamic content as well as to act on the actions you trigger via the GUI. Under some unknown conditions, the frontend might lose communication with the backend process (referred to as "offline", though not related to a connection to the Internet), possibly due to the backend process having crashed or been terminated. That "offline" state produces the symptoms you report here and in IDE 2.1.0 freezes during compile after a period of sleep

Hi There,
I can confirm that opening a New Sketch does indeed restore the missing example menu entries, and I am happy with that as a workaround. If I can determine a simple and repeatable method to replicate the missing menus I will certainly pass them on. There is nothing worse that chasing a bug that you know is there but can't replicate at will.

Out of curiosity I took a closer look at Task Manager and noted that from startup there were 14 tasks associated with the IDE. A couple related to Windows commands processing and two more for the serial port leaving 9 for the IDE plus one for the CLI. That just seemed surprising.

Regards,
Graham

1 Like

Hi Everyone,
First time to make any comments.
I just wanted to say that yesterday I loaded some new library's to my IDE and the next day they were not there.
I discovered that going to the drop down tab to the right of the "Start Debugging " selection ( in my case "Arduino Nano 33 IoT ") I found that I had 2 options. One using COM3 and the other COM7.
Selecting the one with COM7 showed all my Library's and COM3 did not.
I think when I loaded them I was using com7 on my PC.

Could this be the problem?
I'm using IDE ver. 2.1.1

1 Like

Hi @gascap

What exactly do you mean by "not there"? Do you mean that the example sketches of the libraries are not listed under the File > Examples menu in Arduino IDE?

Something to note is that this menu selects the board in addition to the port. The libraries you install via the Arduino IDE Library Manager should always be listed regardless of which board you have selected, but there is also a special type of library that is only listed when you have one of the boards it is associated with selected. So it is expected that the contents of the File > Examples and Sketch > Libraries menus can change depending on which board you have selected in Arduino IDE.

Yes.
I was using Nano 33 IoT but did change com ports between 3 and 7.
I loaded libraries for OLED display (Adafruit GFX and SSD1306).

File > Examples:
"Examples form Custom Library" (GFX and SSD1306 were not there).

When I found the example libraries under com7, I changed the port to com3 and saved it and now they show up in both com ports.

On another PC with new download of Ver. 2.1.1 I downloaded Adafruit GFX and SSD1306 to use an OLED 12x64 display.
Today I opened up IDE and did not see any of the "Examples from Custom Library" that were there before.
I found that if I started a new sketch, I could see them but only in the new sketch and not in the previous sketch.

Seems strange.

You might have to scroll down to see them?

I did....
Also just noticed that after I installed "Dallas Temperature" library, all those missing Custom libraries showed up.

Is this me, or a bug in the program.

Sometimes you have to be patient, possibly even have to restart the IDE.

I just installed three ZIP libraries; after the second one, the list under sketch → include libraries was empty. With patience it would probably have come back. And similar to your experience, it came back after I installed the third one.

The problem of the Examples menu not always showing all the installed libraries is tracked by the Arduino IDE developers here:

If you have a GitHub account, you can subscribe to that issue to get notifications of any new developments related to this subject:

image

You can all ways access the library examples directly from the file system.
I don’t know the exact pathway but @ptillisch probably knows.

In the libraries directory inside the sketchbook directory.

1 Like

Opening a New sketch workaround help for me.

Thanks a lot

Serge

1 Like

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