Recently I've got a problem where Arduino IDE / Compiler was unable to locate a library that was installed in Documents\Arduino\libraries folder and the compilation failed.
After some investigation it seems that cc1plus.exe is unable to locate libs in folders whose names contain Cyrillic chars (under Windows) which is strange since folder names under Windows are stored in unicode internally.
In my case Documents folder was redirected in OneDrive and the full path was something like:
After changing system's locale from English to Bulgarian (win1251) + restart, the compilation succeeded. Unfortunately this is not viable solution, because we have many computers (>150) and changing system locale requires admin privileges.
My questions are: is there more elegant solution or I need to fire a bug report somewhere (if yes - where)?
Other problem's may arise from using ONEDRIVE or similar cloud based storage for IDE installations.
Would suggest uninstall and move to a fixed drive on your computer.
You may find that after the move it might fix your issue but feel free to add to this post if it does not.
Clean up instructions attached to help with the move.
I don't know if the problem is the cyrillic characters, or the fact that your sketchbook is in OneDrive.
OneDrive has caused a lot of problems (ofc, they keep fiddling with it's behavior each windows update - which makes trying to figure out what causes the problems a nightmare) - it pulls files in "on demand", meaning that sometimes the files that look like they're there in explorer aren't actually on your computer yet. Whatever sleight of hand OneDrive uses to hide this doesn't work reliably on the compiler.
Don't put your sketchbook folder in OneDrive. I achieve backups on my sketchbook folder by treating the whole mess as a private github repo (github now lets free accounts do a limited number of private repos).