error Loading ESP32 Board in Arduino

In Board manager getting following message

<<
Error downloading https://downloads.arduino.cc/packages/package_index.json

I have set in preferences

<<
https://dl.espressif.com/dl/package_esp32_index.json , http://arduino.esp8266.com/stable/package_esp8266com_index.json

getting following msg
<<
rror downloading https://downloads.arduino.cc/packages/package_index.json
java.lang.RuntimeException: java.lang.Exception: Error downloading https://downloads.arduino.cc/packages/package_index.json
at cc.arduino.contributions.packages.ui.ContributionManagerUI.lambda$onUpdatePressed$1(ContributionManagerUI.java:150)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.Exception: Error downloading https://downloads.arduino.cc/packages/package_index.json
at cc.arduino.contributions.DownloadableContributionsDownloader.download(DownloadableContributionsDownloader.java:139)
at cc.arduino.contributions.packages.ContributionInstaller.download(ContributionInstaller.java:333)
at cc.arduino.contributions.packages.ContributionInstaller.downloadIndexAndSignature(ContributionInstaller.java:307)
at cc.arduino.contributions.packages.ContributionInstaller.updateIndex(ContributionInstaller.java:285)
at cc.arduino.contributions.packages.ui.ContributionManagerUI.lambda$onUpdatePressed$1(ContributionManagerUI.java:146)
… 1 more
Caused by: java.nio.file.FileSystemException: C:\Users\Admin\AppData\Local\Arduino15\package_index.json.tmp: The process cannot access the file because it is being used by another process.

at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:86)
at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102)
at sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:269)
at sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:103)
at java.nio.file.Files.delete(Files.java:1126)
at cc.arduino.utils.network.FileDownloader.downloadFile(FileDownloader.java:156)
at cc.arduino.utils.network.FileDownloader.download(FileDownloader.java:132)
at cc.arduino.contributions.DownloadableContributionsDownloader.download(DownloadableContributionsDownloader.java:137)
… 5 more

Ha, good work! I was just typing out a request for you to post that, but you beat me to it.

Here is the important part:

Caused by: java.nio.file.FileSystemException: C:\Users\Admin\AppData\Local\Arduino15\package_index.json.tmp: The process cannot access the file because it is being used by another process.

This sort of error could be caused by your antivirus software. Try TEMPORARILY disabling your antivirus for a single compilation to see if the problem goes away, then turn the antivirus back on. If the problem doesn't occur with the antivirus off you will need to adjust the settings of your antivirus to whitelist the appropriate file, folder, or process so it doesn't interfere with compilation.

will try and get back

Hello Pert

The turning of antivirus did not help .
But deleting the file < package_index.json.tmp> on my computer solved the matter.

Thanks anyway

Thanks for posting an update with your solution. I'm glad to see you got it working now. Enjoy! Per

I’ve had the same problem for a few days and can’t resolve it.

pawarviren, you indicated that deleting <package_index.json.tmp> resolved the problem. I had <package_esp32_index.json.sig.tmp> in …\AppData\Local\Arduino15. Is that the right folder? That folder also has <package_index.json> but no temp version. The only message when loading the board manager is the following (that’s with show verbose output during both compilation and upload):

Error downloading https://dl.espressif.com/dl/package_esp32_index.json
WARNING: Error loading hardware folder C:\D\NonSML\WK\AutoKite\Arduino\hardware\espressif
  No valid hardware definitions found in folder espressif.
WARNING: Error loading hardware folder C:\D\NonSML\WK\AutoKite\Arduino\hardware\espressif
  No valid hardware definitions found in folder espressif.

As part of trying to resolve this I’d updated my IDE to 1.8.10. Perhaps I should go back a few versions? I had been running ESP32s fine but updated when I had the following error when trying to get a BLE connection working. I’ll go back to that

[E][BLEDevice.cpp:343] init(): esp_bt_controller_init: rc=259

just edit the file C:\Users\Admin\AppData\Local\Arduino15\package_esp32_index.json in notepad++ or any supporting editor.

Delete the checksum details inside " " according to the version like 1.0.4 or else.

Save it and open board manager of arduino.

now download the esp32 board manager file..