Compilation error

I am having trouble because code that used to compile correctly has suddenly started throwing a compilation error since yesterday.
Please let me know how to resolve this.

Error message:

<built-in>: fatal error: opening dependency file /var/run/arduino/run/arduino/custom-libraries/Adafruit RGB LCD Shield Library/utility/Adafruit_MCP23017.cpp.libsdetect.d: No such file or directory

Sketch:

#include <Adafruit_RGBLCDShield.h>
#include <utility/Adafruit_MCP23017.h>

Thanks for bringing this to our attention @t_aka. I confirm the bug and have submitted a formal report to the Arduino Cloud developers on your behalf. I'll post an update here if I receive any news from them.

I apologize for any inconvenience caused by the bug.

Workaround

I'll provide instructions you can follow to work around the bug:

  1. Click the following link to download a version of the "Adafruit RGB LCD Shield Library" library I modified so that it will not be affected by the bug:
    Adafruit-RGB-LCD-Shield-Library.zip (17.3 KB)
  2. Wait for your browser to finish the file download.
  3. Open your sketch in Arduino Cloud Editor.
  4. Click the icon that looks like shelved books ("Libraries") in the bar on the left side of the Cloud Editor page.
    The "Libraries" panel will open.
  5. Click the upward pointing arrow icon at the top of the "Libraries" panel.
    The "Open" dialog will open.
  6. Select the "ZIP" file of the library in the dialog.
  7. Click the "Open" button.
    The "Open" dialog will close.
  8. You will now see an indicator at the top of the "Libraries" panel in place of the upward pointing arrow icon as the library is imported. Wait for this indicator to disappear.

Now try compiling or uploading the sketch again, just as you did before when you encountered the error. Hopefully everything will work as expected this time.


โ“˜ If you later decide you want to remove the imported library from your Arduino Cloud account, you will find it under the "Custom" tab of the "Libraries" panel.



Please let us know if you have any questions or problems while following those instructions.

Explanation

In case you might be curious to know the boring details, I've provided them below. If you aren't interested in that, you can skip reading the rest of this post.

The problem is caused by an incompatibility between Arduino Cloud Editor and the specific "flat library layout" used by the "Adafruit RGB LCD Shield Library" library (the library that contains the header files Adafruit_RGBLCDShield.h and utility/Adafruit_MCP23017.h).

This is the file structure of the library:

โ”œโ”€โ”€ utility/
โ”‚   โ”œโ”€โ”€ Adafruit_MCP23017.cpp
โ”‚   โ””โ”€โ”€ Adafruit_MCP23017.h
โ”œโ”€โ”€ Adafruit_RGBLCDShield.cpp
โ”œโ”€โ”€ Adafruit_RGBLCDShield.h
โ”œโ”€โ”€ library.properties
...

This means the bug can be worked around by converting the library to the alternative "recursive library layout", with the following file structure:

โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ Adafruit_RGBLCDShield.cpp
โ”‚   โ”œโ”€โ”€ Adafruit_RGBLCDShield.h
โ”‚   โ””โ”€โ”€ utility/
โ”‚       โ”œโ”€โ”€ Adafruit_MCP23017.cpp
โ”‚       โ””โ”€โ”€ Adafruit_MCP23017.h
โ”œโ”€โ”€ library.properties
...

The modified version of the library I provided you is simply the library adjusted to use the "recursive" library layout you see in the diagram above. The source code remains the same. It was only necessary to move the library's code files under a subfolder named src.

ptillisch-san,
Thank you for your assistance.
I was able to compile successfully by following the steps provided.
If possible, it would be helpful if you could announce when it is safe to remove this from the custom library once the official bug fix is โ€‹โ€‹released.
I appreciate your help with this.

You are welcome. I'm glad you were able to proceed after performing the workaround.

I will be sure to post an update here if I receive news from the developers that the bug has been fixed. As you say, it will be a good idea to remove the modified library from the "custom libraries" of your Arduino Cloud account, as it is always best to use the official Adafruit library when possible.

Hello again @t_aka. I'm happy to report that the developers have now fixed the bug that caused the "<built-in>: fatal error: opening dependency file /var/run/arduino/run/arduino/custom-libraries/Adafruit RGB LCD Shield Library/utility/Adafruit_MCP23017.cpp.libsdetect.d: No such file or directory" error you encountered:

So you should now be able to successfully compile your sketches without needing to use the modified version of the "Adafruit RGB LCD Shield Library" library you installed following my instructions in post #2.

I'll provide instructions you can follow to remove the modified version of the library from your Arduino Cloud again so that Cloud Editor will once again use the official Adafruit library that is installed globally on the Arduino Cloud server:

  1. Open your sketch (or create a new sketch if you don't already have one) in Arduino Cloud Editor.
    The sketch will open in Arduino Cloud Editor.

  2. Click the icon that looks like shelved books ("Libraries") in the bar on the left side of the Cloud Editor page.
    The "Libraries" panel will open.

  3. Select the "Custom" tab from the "Libraries" panel.

  4. You will see text near the top of the panel:

    Show libraries for:
    <board name>

    (where <board name> is the name of the board you have selected in Arduino Cloud Editor)
    Click the board name in that text.
    The text will now change to:

    Show libraries for:
    ALL DEVICES

  5. Find the entry for the "Adafruit RGB LCD Shield Library" library in the list of custom libraries shown in the panel.

  6. Hover the mouse pointer over the "Adafruit RGB LCD Shield Library" entry.
    A โ‹ฎ icon will appear to the right of the library name.

  7. Click the โ‹ฎ icon to the right of the library name.
    A menu will open.

  8. Select "Delete Library" from the menu.
    A "Delete custom library" dialog will open.

  9. Click the "YES, DELETE" button in the dialog.

Now try compiling or uploading your sketch again, just as you did before when you encountered the spurious error. Hopefully this time everything will work as expected.


Please let us know if you have any questions or problems while following those instructions.

ptillisch-san,
I have confirmed that it works correctly with the Arduino official library.
Thank you very much for letting me know.

I think it would be a good idea for Adafruit to switch to the new library format, since the flat formatโ€”as far as I recallโ€”has been marked as deprecated for several years.