Arduino cannot download libraries and library index

Whenever I open the library index, it show no packages, says there is an error downloading the library index, and prints this in the Serial Console:

Error downloading https://downloads.arduino.cc/libraries/library_index.json
java.lang.RuntimeException: java.lang.Exception: Error downloading https://downloads.arduino.cc/libraries/library_index.json
at cc.arduino.contributions.libraries.ui.LibraryManagerUI.lambda$onUpdatePressed$2(LibraryManagerUI.java:210)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.Exception: Error downloading https://downloads.arduino.cc/libraries/library_index.json
at cc.arduino.contributions.DownloadableContributionsDownloader.download(DownloadableContributionsDownloader.java:149)
at cc.arduino.contributions.DownloadableContributionsDownloader.download(DownloadableContributionsDownloader.java:130)
at cc.arduino.contributions.JsonDownloader.download(JsonDownloader.java:49)
at cc.arduino.contributions.GZippedJsonDownloader.download(GZippedJsonDownloader.java:66)
at cc.arduino.contributions.libraries.LibraryInstaller.updateIndex(LibraryInstaller.java:84)
at cc.arduino.contributions.libraries.ui.LibraryManagerUI.lambda$onUpdatePressed$2(LibraryManagerUI.java:203)
... 1 more
Caused by: java.lang.NumberFormatException: For input string: ""
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:592)
at java.lang.Integer.valueOf(Integer.java:766)
at cc.arduino.net.CustomProxySelector.manualProxy(CustomProxySelector.java:146)
at cc.arduino.net.CustomProxySelector.getProxyFor(CustomProxySelector.java:71)
at cc.arduino.utils.network.HttpConnectionManager.makeConnection(HttpConnectionManager.java:124)
at cc.arduino.utils.network.HttpConnectionManager.makeConnection(HttpConnectionManager.java:106)
at cc.arduino.utils.network.FileDownloaderCache.updateCacheInfo(FileDownloaderCache.java:184)
at cc.arduino.utils.network.FileDownloaderCache.getFileCached(FileDownloaderCache.java:153)
at cc.arduino.utils.network.FileDownloader.downloadFile(FileDownloader.java:167)
at cc.arduino.utils.network.FileDownloader.download(FileDownloader.java:129)
at cc.arduino.contributions.DownloadableContributionsDownloader.download(DownloadableContributionsDownloader.java:147)
... 6 more

I am running macOS High Sierra, and the firewall is off.

Screen Shot 2021-03-16 at 8.36.29 AM.png

Screen Shot 2021-03-16 at 8.36.29 AM.png

What do you see if you open https://downloads.arduino.cc/libraries/library_index.json in your browser? You should see a huge JSON document that looks like this:

{
  "libraries": [
    {
      "name": "AudioZero",
      "version": "1.0.1",
      "author": "Arduino",
      "maintainer": "Arduino \u003cinfo@arduino.cc\u003e",
      "sentence": "Allows playing audio files from an SD card. For Arduino Zero only.",
      "paragraph": "With this library you can use the Arduino Zero DAC outputs to play audio files.\u003cbr /\u003eThe audio files must be in the raw .wav format.",
      "website": "https://www.arduino.cc/en/Reference/Audio",
      "category": "Signal Input/Output",
      "architectures": [
        "samd"
      ],
      "types": [
        "Arduino"
      ],
      "repository": "https://github.com/arduino-libraries/AudioZero.git",
      "url": "https://downloads.arduino.cc/libraries/github.com/arduino-libraries/AudioZero-1.0.1.zip",
      "archiveFileName": "AudioZero-1.0.1.zip",
      "size": 5836,
      "checksum": "SHA-256:980a6168380e9e46a6d9780f7d904d5845902b6fb53cb4e30bdc044114546613"
    },

...and on and on for 4000 libraries!

If that looks OK, then try opening the local file at ~/Library/Arduino15/library_index.json in a text editor. Does it look similar to file in the browser?

The browser file looks ok, but I don't have the file in my computer.
This isn't good, right?

Do you have a modified proxy configuration under the "Network" tab of the Arduino IDE's File > Preferences dialog? Or is it set to the default "Auto-detect proxy settings" setting, with the "Automatic proxy configuration URL" checkbox unchecked?

It works now.
Thanks!

pert:
Do you have a modified proxy configuration under the "Network" tab of the Arduino IDE's File > Preferences dialog? Or is it set to the default "Auto-detect proxy settings" setting, with the "Automatic proxy configuration URL" checkbox unchecked?

I actually have the same problem, and I checked my preferences and they are as you wrote they should be. but I still have the error message

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