Cannot upload sketch: java.io.IOException

Hello,

I’ve read the notes for newbies like myself.

In trying to use the IDE (v1.18.13 under Ubuntu 20.04), I’m stumbling at the starting gate with a Nano33 BLE Sense and the Blink sketch. The Board & Port are correct because the Get Board Info returns the expected data. The error message for the Upload operation is:

Arduino: 1.8.13 (Linux), Board: "Arduino Nano 33 BLE"

Sketch uses 76356 bytes (7%) of program storage space. Maximum is 983040 bytes.
Global variables use 42160 bytes (16%) of dynamic memory, leaving 219984 bytes for local variables. Maximum is 262144 bytes.
java.io.IOException: Cannot run program "___REMOVE___/bossac": error=2, No such file or directory
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
	at java.lang.Runtime.exec(Runtime.java:620)
	at java.lang.Runtime.exec(Runtime.java:485)
	at processing.app.helpers.ProcessUtils.exec(ProcessUtils.java:11)
	at cc.arduino.packages.Uploader.executeUploadCommand(Uploader.java:129)
	at cc.arduino.packages.uploaders.SerialUploader.runCommand(SerialUploader.java:383)
	at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:197)
	at cc.arduino.UploaderUtils.upload(UploaderUtils.java:77)
	at processing.app.SketchController.upload(SketchController.java:732)
	at processing.app.SketchController.exportApplet(SketchController.java:703)
	at processing.app.Editor$UploadHandler.run(Editor.java:2055)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.IOException: error=2, No such file or directory
	at java.lang.UNIXProcess.forkAndExec(Native Method)
	at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)
	at java.lang.ProcessImpl.start(ProcessImpl.java:134)
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
	... 11 more
An error occurred while uploading the sketch


This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

The IDE works fine with UNO, MKR1000, Nano & ESP32xx boards. I cut and pasted the standard Blink sketch into the Web Editor and that permitted me to verify that the Nano33 BLE Sense board was fine.

Boards Manager informs me that I have v1.1.4 installed. Attempts to upgrade to v1.1.6 failed with the following message:

java.lang.NullPointerException
java.lang.RuntimeException: java.lang.NullPointerException
	at cc.arduino.contributions.packages.ui.ContributionManagerUI.lambda$onInstallPressed$2(ContributionManagerUI.java:175)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException
	at cc.arduino.contributions.packages.ContributionInstaller.remove(ContributionInstaller.java:276)
	at cc.arduino.contributions.packages.ui.ContributionManagerUI.lambda$onInstallPressed$2(ContributionManagerUI.java:170)
	... 1 more

My only attempt at troubleshooting was to remove the Arduino IDE files and re-install a fresh download using the ./install.sh script.

Any advice will be gratefully applied for the resolution of this operator/user error. Many thanks.

Kind regards.

This error indicates something has gone wrong with a hardware package installed via Boards Manager. The solution is to remove and then re-install the packages. Be aware this will remove any boards you have installed via Boards Manager:

  • (In the Arduino IDE) File > Preferences
  • Click the link on the line following "More preferences can be edited directly in the file". This will open the ~/.arduino15 folder.
  • Delete all files and folders under the Arduino15 folder except for preferences.txt. Please be very careful when deleting things from your computer. When in doubt, back up!
  • (In the Arduino IDE) Tools > Board > Boards Manager
  • Wait for the downloads to finish.
  • Reinstall the board platforms you need.
  • Click "Close"

A very big THANK YOU!

Kind regards.

You're welcome. I'm glad if I was able to be of assistance. Enjoy!
Per