Description
I'm receiving the following error with the newly downloaded Arduino IDE 1.6.5-r4, when compiling any sketch.
java.lang.NullPointerException
at cc.arduino.LoadVIDPIDSpecificPreferences.load(LoadVIDPIDSpecificPreferences.java:48)
at processing.app.debug.Compiler.createBuildPreferences(Compiler.java:592)
at processing.app.debug.Compiler.(Compiler.java:193)
at processing.app.debug.Compiler.build(Compiler.java:96)
at processing.app.Sketch.build(Sketch.java:1109)
at processing.app.Sketch.build(Sketch.java:1084)
at processing.app.Editor$BuildHandler.run(Editor.java:1955)
at java.lang.Thread.run(Thread.java:745)
I need to have my Arduino Pro Mini board (most likely a Chinese knock-off) connected via USB and have that COM port selected for this error to show up. The port shows up as e.g. COM4, with no additional parenthesis like my Arduino Uno which shows up as COM7 (Arduino Uno).
Disconnecting this device (i.e. selecting none), or connecting and selecting my Arduino Uno, allows me to compile.
Source file at fault:
https://github.com/arduino/Arduino/blob/1.6.5-r4/arduino-core/src/cc/arduino/LoadVIDPIDSpecificPreferences.java
This file is new as of 1.6.5-r4
Line 48:
int VIDPIDIndex = findVIDPIDIndex(prefs, boardPort.getPrefs().get("vid").toUpperCase(), boardPort.getPrefs().get("pid").toUpperCase());
One, or likely both, of the boardPort.getPrefs().get(String) functions returns null, which throws this exception when calling .toUpperCase() on a null value (default return value from java.util.LinkedHashMap.get() when no match is found).
Possible suggestion to fix this (you likely know better if this has any other side effects); use a default option for the get() function of PreferencesMap data structure.
int VIDPIDIndex = findVIDPIDIndex(prefs, boardPort.getPrefs().get("vid","").toUpperCase(), boardPort.getPrefs().get("pid","").toUpperCase());
Activity
cmaglie commentedon Aug 27, 2015
Thanks for the quick and detailed report!
We'll check this out ASAP.
haaland1 commentedon Aug 27, 2015
I am having the same issue. I downloaded version 1.6.5 of Arduino IDE this morning and receive the same error when compiling code with my Arduino Pro Mini connected via USB.
java.lang.NullPointerException
at cc.arduino.LoadVIDPIDSpecificPreferences.load(LoadVIDPIDSpecificPreferences.java:48)
at processing.app.debug.Compiler.createBuildPreferences(Compiler.java:592)
at processing.app.debug.Compiler.(Compiler.java:193)
at processing.app.debug.Compiler.build(Compiler.java:96)
at processing.app.Sketch.build(Sketch.java:1109)
at processing.app.Sketch.exportApplet(Sketch.java:1127)
at processing.app.Sketch.exportApplet(Sketch.java:1113)
at processing.app.Editor$DefaultExportHandler.run(Editor.java:2380)
at java.lang.Thread.run(Thread.java:745)
The sketch compiles fine when the board is disconnected.
mojtabacazi commentedon Aug 27, 2015
same here
Arduino Mega 2560
Juanah commentedon Aug 27, 2015
downgrade to 1.6.4 ;)
objectiveSee commentedon Aug 27, 2015
Oh geez I guess I'll downgrade too!
netstv commentedon Aug 27, 2015
I get it on the nano as well.. downgrading...
PaulStoffregen commentedon Aug 27, 2015
I'm also seeing the bug here. :(
If you're going to downgrade, you'll probably want to skip 1.6.4 and go back to 1.6.3, so you don't get hit with issue #3115.
netstv commentedon Aug 27, 2015
I don't seem to have that problem. (Yet)
dmjlambert commentedon Aug 28, 2015
Perhaps 1.6.5-r2 could be posted on the website download section again, since there have been several issues brought up in the forum about this. New users are having trouble.
cmaglie commentedon Aug 28, 2015
The fix is available for download as 1.6.5-r5:
https://www.arduino.cc/en/Main/Software
11 remaining items