I had the IDE working perfectly in versions 1.0.x right up the 1.8.19. The sketch folder was where I waned it (D:\Files\Arduino). The library folder was in the right place (D:\Files\Arduino\library). Libraries worked perfectly. Libraries that I had saved to my hard drive and then added using the Add zip option worked fine.
Then I installed version 2 and it's been an absolute nightmare. I’m currently on version 2.3.6. I’ve already wasted a day fighting the IDE and I’m still no closer to getting projects to compile that used to work under 1.8.19.
There's no option to change the location of the library folder from the default (C:\Users\Bob\AppData\Local\Arduino15\libraries). Supposedly it can be done by editing a config file but those are splattered across at least 4 different and obscure folders, with no information about how or which of the many config files need to be edited. Saved libraries that worked under version 1.x.x. now fail all attempts to add them in 2.3.6. The add library from zip function doesn't even remember the last folder it just looked at, instead returning to C:\Users[username]\ every time.
What gives? How do you get the IDE to actually do the job of being an IDE instead of fighting every attempt to get it to work?
Ok, that’s the first problem. Why are the config files, libraries and other stored there when I told the the program to install on D drive? I did find that config file, updated it and copied the libraries folder to D:\Files\Arduino\library. Since then I haven’t been able to add libraries using the add zip method.
Error messages. There is this one every time I open the IDE. If I say yes it then pops up the windows firewall. I allow access then get two UAC popups in a row wanting internet access. This is not a one off thing, it’s every time I open the IDE. The "Arduino AVR Boards [v 1.8.6]" core has to be installed for the currently selected "Arduino Uno" board. Do you want to install it now?
Compiling I get
D:\Files\Arduino\AISlogger01\AISlogger01.ino:87:10: fatal error: Adafruit_Sensor.h: No such file or directory
#include <Adafruit_Sensor.h>
^~~~~~~~~~~~~~~~~~~
compilation terminated.
exit status 1
Compilation error: Adafruit_Sensor.h: No such file or directory
Adding the library from zip I get:
Error: 13 INTERNAL: Library install failed: moving extracted archive to destination dir: user directory not set
I have no idea. There is one difference between IDE2.x and IDE 1.x that might be relevant.
IDE 1.x comes with the AVR board package (for IDE 1.8.19 it is AVR 1.8.3); it will be in the installation directory.
IDE 2.x does not come with the AVR board package and the IDE wants to download and install it at first run (and needs internet access for that).
I assume that you said yes.
Please show the content of the arduino-cli.yaml with regards to the directories?
Did you check if the AVR core is installed in the specified data directory after you confirmed the installation (and before you close the IDE again)? De full path (on my system) is C:\Users\bugge\AppData\Local\Arduino15\packages\arduino\hardware\avr with a subdirectory for the version.
Did you check if the AVR core is still there after you closed the IDE?
The library is either not installed or incorrectly installed / corrupt
Please provide arduino-cli.yaml (or at least the relevant section) as in my previous reply.
If the only thing that you want to achieve is to have the sketchbook directory (with the libraries directory) somewhere on your D: drive the only thing you have to change is the user directory in arduino-cli.yaml.
And that setting is also available from File → Preferences.
IDE 2.x does not come with the AVR board package and the IDE wants to download and install it at first run (and needs internet access for that).
That is a truly awful decision on the part of the developers. Many of operate in places that have no internet access whatsoever. Having a project stuck for months at a time because some developer decided not to bother including everything in the installer is a major issue. Looks like version 2 of the IDE can’t be trusted so I’ll be going back to 1.8.19.
The motivation was, as far as I know, that you will get the latest AVR platform installed.
So you actually want the IDE to come with every possible platform (ESP32, STM32, ...)? That has never been the case (IDE 1.x versions included). And there are workable workarounds as long as you have one system (with the same operating system) that has the IDE and can connect to the internet.
The AVR core version that comes with IDE 1.8.19 is AVR core 1.8.3. What would you do if you would have bought a Arduino Uno Mini Ltd? Not supported so you will have to upgrade to AVR core 1.8.5.
And users that started with the Make Your Uno Kit have to upgrade to AVR core 1.8.6.
It will be a lot easier if the latest (and always the latest) AVR core can be installed when the IDE is installed.
What about libraries? Do you want every single one of them to be included as well?