[Solved] Arduino IDE 1.6.8 crashing at startup on Linux (Xubuntu 18.04)

After:

  • downloading XZ-archive of latest (1.8.6) Arduino IDE
  • unpacking into my home area
  • cd arduino-1.8.6
  • ./install.sh (getting only the one expected log line)
  • ./arduino

The Arduino IDE splash screen appear for some seconds (telling: Initializing packages… Installing boards…), before the whole thing crashes with the following stackdump:

$ ./arduino
Picked up JAVA_TOOL_OPTIONS: 
Invalid version found: 1.04
java.lang.NullPointerException
	at processing.app.packages.UserLibrary.create(UserLibrary.java:156)
	at cc.arduino.contributions.libraries.LibrariesIndexer.scanLibrary(LibrariesIndexer.java:213)
	at cc.arduino.contributions.libraries.LibrariesIndexer.scanInstalledLibraries(LibrariesIndexer.java:190)
	at cc.arduino.contributions.libraries.LibrariesIndexer.rescanLibraries(LibrariesIndexer.java:150)
	at cc.arduino.contributions.libraries.LibrariesIndexer.setLibrariesFolders(LibrariesIndexer.java:109)
	at processing.app.BaseNoGui.onBoardOrPortChange(BaseNoGui.java:677)
	at processing.app.Base.onBoardOrPortChange(Base.java:1313)
	at processing.app.Base$11.actionPerformed(Base.java:1514)
	at processing.app.Base.rebuildBoardsMenu(Base.java:1490)
	at processing.app.Base.<init>(Base.java:267)
	at processing.app.Base.main(Base.java:145)
$

I have been googling all around on both JAVA_TOOL_OPTIONS and the traceback itself, and found none working solutions?

$ uname -a
Linux kar-HP-EliteBook-6930p 4.15.0-33-generic #36-Ubuntu SMP Wed Aug 15 13:44:35 UTC 2018 i686 i686 i686 GNU/Linux

SOLUTION:
Solution was to remove old libraries-catalog under my ~/sketchbook catalog, as well as the ./libraries/UIPEthernet. I also decided to keep the installation version named arduino-1.8.6 and then reference it with a softlink found as ~/Arduino/

This is a Arduino IDE 1.8.6 specific bug caused by installing a library with an invalid version value in its library.properties file.

The solution is to either remove the offending library or to fix its version value. Unfortunately the Arduino IDE doesn’t bother to provide the essential information of which library has the error so it can be difficult to find. I happen to recognize this particular bad version number. It’s likely the arduino_uip library that’s the cause of the problem. Most likely you installed this library to the libraries subfolder of your sketchbook folder. You should delete that library and then, after verifying the Arduino IDE will now start. The version of the library you’re using was written for Arduino IDE 1.0.x. There is a separate branch for newer Arduino IDE versions and you should install that version of the library:
https://github.com/ntruchsess/arduino_uip/tree/Arduino_1.5.x

I have already reported this bug to Arduino:
https://github.com/arduino/Arduino/issues/7917

Thank you Pert for such fast reply!
When I followed the last link, I used the suggested commands as you see here:

arduino-1.8.6$ cd libraries/
arduino-1.8.6/libraries$ git clone https://github.com/ntruchsess/arduino_uip UIPEthernet
Cloning into 'UIPEthernet'...
remote: Counting objects: 1129, done.
remote: Total 1129 (delta 0), reused 0 (delta 0), pack-reused 1129
Receiving objects: 100% (1129/1129), 452.63 KiB | 1.01 MiB/s, done.
Resolving deltas: 100% (660/660), done.
kar@kar-HP-EliteBook-6930p:~/arduino-1.8.6/libraries$

But I still had the same error, but then I went up from my working directory ~/arduino-1.8.6 and I renamed one catalog Arduino into old_Arduino, before then mv arduino-1.8.6 Arduino. But still the same error. I also found a catalog sketchbook, where I tried this:

~/sketchbook/libraries$ 
git clone https://github.com/ntruchsess/arduino_uip UIPEthernet
fatal: destination path 'UIPEthernet' already exists and is not an empty directory.

Then I tried the mv sketchbook old_sketchbook and ran again, still fail.
When I simply mv Arduino sketchbook - THEN something different happened:

~/sketchbook$ ./arduino
Picked up JAVA_TOOL_OPTIONS: 
Incorrect IDE installation folder: Your copy of the IDE is installed in a subfolder of your sketchbook.
Please move the IDE to another folder.

Question:
Should I simply remove the whole libraries/ catalog away from ̃~/sketchbook/ and add a copy of libraries/ from ~/Arduino/ (which is now 1.8.6 version)?

karekaa:
When I followed the last link, I used the suggested commands as you see here:

arduino-1.8.6$ cd libraries/

arduino-1.8.6/libraries$ git clone GitHub - ntruchsess/arduino_uip: UIPEthernet: A plugin-replacement of the stock Arduino Ethernet l UIPEthernet
Cloning into 'UIPEthernet'...
remote: Counting objects: 1129, done.
remote: Total 1129 (delta 0), reused 0 (delta 0), pack-reused 1129
Receiving objects: 100% (1129/1129), 452.63 KiB | 1.01 MiB/s, done.
Resolving deltas: 100% (660/660), done.
kar@kar-HP-EliteBook-6930p:~/arduino-1.8.6/libraries$

Ugh. Those are absolutely horrible installation instructions. I didn't see those. I'm going to have to try to get that fixed. The biggest problem is that will clone the master branch, which is the one that has the invalid version. You want the Arduino_1.5.x branch. The other problem is that it's a very bad idea to install libraries under the Arduino IDE installation folder. The reason is that when you update to a new version of the Arduino IDE everything under the old installation folder will be lost. They should be installed to the sketchbook folder, where they will persist through IDE updates. It's really sad that such a popular library has such bad documentation.

So the first thing to do is delete the library you installed by following those instructions, which will be at ~/arduino-1.8.6/libraries/UIPEthernet.

You need to understand there are multiple folders of interest here. One is the Arduino IDE installation folder, which was at ~/arduino-1.8.6/. After deleting the UIPEthernet library The other is your sketchbook folder. In addition to being a convenient place to store sketches, the sketchbook folder also has a libraries subfolder where the user's libraries should be installed. By default the sketchbook is at ~/Arduino but you can change the sketchbook location via the Arduino IDE's File > Preferences > Sketchbook location. It's possible that you changed your sketchbook location to ~/sketchbook.

karekaa:
I also found a catalog sketchbook, where I tried this:

~/sketchbook/libraries$ 

git clone GitHub - ntruchsess/arduino_uip: UIPEthernet: A plugin-replacement of the stock Arduino Ethernet l UIPEthernet
fatal: destination path 'UIPEthernet' already exists and is not an empty directory.

You need to delete that installation also. You're going about this whole thing in the wrong order. You need to remove all installations of UIPEthernet library. Then verify that you can start the Arduino IDE. Only then should you start on re-installing the UIPEthernet library.

karekaa:
Then I tried the mv sketchbook old_sketchbook and ran again, still fail.
When I simply mv Arduino sketchbook - THEN something different happened:

~/sketchbook$ ./arduino

Picked up JAVA_TOOL_OPTIONS:
Incorrect IDE installation folder: Your copy of the IDE is installed in a subfolder of your sketchbook.
Please move the IDE to another folder.

Noooo! What are you doing? You're bashing around causing a lot of new problems for yourself. As I said before, the Arduino IDE installation and the sketchbook are two separate things. Don't try to move the Arduino IDE installation around. It was fine where it was.

Here's the correct installation instructions for the UIPEthernet library:

I'm sorry for messing things up - but now I understand, and was able to fix things up:

  • renamed back to "arduino-1.8.6" and made a soft link "Arduino" pointing to this
  • removed ~/sketchbook/libraries/... all together
  • removed ~/Arduino/libraries/UIPEthernet
  • NOW: Arduino IDE starts!
  • I was also able to compile, upload and sucessfully run the blink-sketch on an UNO-board on /dev/ttyUSB1

Thank you so much pert - You have been so fast and supportive with my problem!
:smiley:

PS1:
I did get this message in the log window (Update: The last warning went away on second upload!):

Sketch uses 930 bytes (2%) of program storage space. Maximum is 32256 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.
Problem uploading to board.  See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.

PS2:
The same problem with the IDE not starting, reoccurred when I ran the:

git clone https://github.com/ntruchsess/arduino_uip UIPEthernet

Biblioteca inválida encontrada em C:\Users\Raquel\Documents\Arduino\libraries\sketch_aug24a: C:\Users\Raquel\Documents\Arduino\libraries\sketch_aug24a

coloca pra carregar aparece essa msn

karekaa:
now I understand, and was able to fix things up

Glad to hear! The Arduino developers have already been working on a fix for this bug, but that won't help the problem until the next version of the Arduino IDE is released.

karekaa:
PS2:
The same problem with the IDE not starting, reoccurred when I ran the:

git clone https://github.com/ntruchsess/arduino_uip UIPEthernet

That's to be expected. When you don't specify a branch to git clone it clones the default branch (master). The default branch of GitHub - ntruchsess/arduino_uip: UIPEthernet: A plugin-replacement of the stock Arduino Ethernet l has the invalid version. There is another branch named Arduino_1.5.x which has a valid version. The reason for the two branches is one is intended for use with Arduino IDE 1.0.x and the other is intended for newer IDE versions. That's silly because it's easy enough to make the library compatible with all IDE versions and this has caused a tremendous amount of confusion.

You could specify the correct branch to the git clone command like this:

git clone --branch Arduino_1.5.x https://github.com/ntruchsess/arduino_uip UIPEthernet

The problem with that is the folder structure of the Arduino_1.5.x branch is different so this command would create the following structure:

libraries
|_UIPEthernet
   |_UIPEthernet

That won't work because it creates an extra folder level and the Arduino IDE requires libraries to be installed directly under the libraries folder. Of course you could just move the library up one folder level but it's less complicated in the end just to download the .zip file created by GitHub. It's quite unfortunate that the library was moved to a subfolder in the Arduino_1.5.x branch because if it was in the root folder there would be another even easier installation method via the Arduino IDE"s "Add .ZIP Library" feature. It's a really great library but the author doesn't seem to really understand the basics of how the Arduino IDE works

antoniomarcos91:
Biblioteca inválida encontrada em C:\Users\Raquel\Documents\Arduino\libraries\sketch_aug24a: C:\Users\Raquel\Documents\Arduino\libraries\sketch_aug24a

coloca pra carregar aparece essa msn

That has nothing to do with this topic. Please don't hijack threads. You have a sketch in your libraries folder. That folder is not the place to put sketches. Only put libraries in the libraries folder. You can put sketches anywhere else you like but not there.

Oh thanks again pert!

The "--branch Arduino_1.5.x" did the thing, in combination of cleaning the extra structure!

:smiley:

pert:
The Arduino developers have already been working on a fix for this bug, but that won't help the problem until the next version of the Arduino IDE is released.

If anyone needs a quick fix (which isn't downgrading to 1.8.5), I put the #7922 patch into my Teensyduino installer.

https://forum.pjrc.com/threads/53574-Teensyduino-1-43-Beta-2

Even if you're never going to use Teensy, just running the installer on your copy of Arduino 1.8.6 will fix this startup bug. :slight_smile:

I really like how both #7922 and your proposed fix also fixed the issue of the invalid version error message not specifying which library has the invalid version. That vague error message has made providing support here on the forum much more difficult.

This is the first time I had heard a complaint about the invalid version message. At least for use with Teensy, it just hasn't come up in any way that drew much attention... until just 2 days ago.

Something that has come up over and over is "computer not detecting USB device". Earlier this year I put a huge amount of work into redesigning how USB detection is done for Teensy. The low-level APIs on all 3 systems are used (Windows: configuration manager, MacOS: IOKit/CoreFoundation, Linux: udev) to detect both driver-based devices (eg, COM ports) and also the raw USB device. Starting with 1.42, when Windows or Mac or Linux don't load the serial driver, Teensy still appears in the ports menu as "[no device]" because the discover utilities are looking for raw USB devices and traversing the tree of interfaces to see which ports are associated with them. The many non-Serial modes Teensy supports are also all now properly shown. I'm happy to say these user reports have almost completely evaporated since I released 1.42 in early-June.

Like most the stuff I do for Teensy, my intention is to eventually contribute this back to Arduino. Historically, it takes 1 to 2 years to get Arduino to warm up to major changes and accept them. The "DiscoverManager" is one of the parts of the Arduino IDE that isn't configurable by boards (Teensyduino installer has to patch its code).... so it's probably going to take some serious work to make this into a contribution that Arduino will someday accept.

NOTHING was working for me, until...

I edited preferences.txt in the Arduino15 directory and removed the text after "board="