arduino / Arduino

Arduino IDE 1.x
https://www.arduino.cc/en/software
Other
14.16k stars 7.02k forks source link

Editor Failing to start #10332

Closed rjs5327 closed 4 years ago

rjs5327 commented 4 years ago

(EDIT by @cmaglie: For people looking for the "solution" here the comment -> https://github.com/arduino/Arduino/issues/10332#issuecomment-641830310)

So i am running a Win 10 machine and on 2 of them i get the same problem, including both the desktop and portable version. This issue just arose all was working and then i got the normal double port error where it shows say COM 8 twice and wont do anything so i rebooted the Editor and it wont start.

Here is the debug print out: Loading configuration... Initializing packages... java.lang.NullPointerException at cc.arduino.contributions.packages.ContributionsIndexer.parseIndex(ContributionsIndexer.java:134) at processing.app.BaseNoGui.initPackages(BaseNoGui.java:483) at processing.app.Base.(Base.java:273) at processing.app.Base.main(Base.java:150)

This all happened after trying to connect to some MKR's having trouble i think they are too close and the WIFI is screwing up. Since the boards randomly reboot and LED_BUILTIN pulses slow. So i been messing with positioning the boards and pulling things out of the code to find the issue. And my machines have locked up with the above. So i tried portable doesnt work. Tried uninstalling and reinstalling does not work. So im stuck

lucasroth commented 4 years ago

@dergizzle hey, another not insane, just sleepless person here! win 10, arduino ide 1.8.10 everything worked fine till reboot of the PC and then the IDE stopped launching. Hours getting crazy about this issue, now can compile and upload deleting the package_index.json from folder: C:\Users\%my username%\AppData\Local\Arduino15 hope the fix is available soon, several hours wasted today! good night

GregS1000RR commented 4 years ago

The only workaround which worked for me was to revert back to 1.8.10

Beta 1.9 isn't able to compile Tasmota project

yellowbluesky commented 4 years ago

The hourly builds (I installed 4 June 2020 0:13:17 GMT) available here are working for me.

I can close and reopen the IDE as many times as I want without issue.

Board manager and Library manager appear to work fine. I have only tested with the Arduino Mega 2560 core

darshit115 commented 4 years ago

I have uninstall 1.8.7 version and reinstall the 1.8.12 version but still i am getting error in Board manager "java.lang.NullPointerException".

S10143806H commented 4 years ago

Can also reproduce this.

  • Fresh install of 1.8.12
  • Add https://arduino.esp8266.com/stable/package_esp8266com_index.json in board manager
  • Go to board manager and get NullPointerException

After that, the editor cannot start any longer and fails with

java.lang.NullPointerException
        at cc.arduino.contributions.packages.ContributionsIndexer.parseIndex(ContributionsIndexer.java:134)
        at processing.app.BaseNoGui.initPackages(BaseNoGui.java:483)
        at processing.app.Base.<init>(Base.java:273)
        at processing.app.Base.main(Base.java:150)

Perhaps something specific with the esp8266 json?

I encountered the same issue after trying to add Add another .json in the board manager

dylanpil commented 4 years ago

I feel a little better, seeing that im not the only one having this issue. I have been stuck on this for approx 4 hours, and it has really ruined my day, as I have projects to finish, and can't get anywhere. I was about to format my computer and start again, thank goodness I see that its not just me.

I found all the same issues, but i am able to get the hourly IDE to open. But this one has Index Error

I hope someone works out a proper solution soon.

Fernandoantvf commented 4 years ago

A workaround for now is to delete the Arduino folder under (C:\Users\user\AppData\Local). The IDE will boot, but you won't have your additional boards available.

Just delete the package_index.json and package_index.json.sig files inside said directory. Will preserve current board support, but you will not be able to install or update boards until this is fixed.

This solution worked for me!

VladoPortos commented 4 years ago

Yesterday it was working ok, turned off pc and went sleep.. come back to turned on PC and not working IDE :-/ same issue as above...

dylanpil commented 4 years ago

@Fernandoantvf did you go to board manager? as this is one part that just doesnt want to work

Fernandoantvf commented 4 years ago

@Fernandoantvf did you go to board manager? as this is one part that just doesnt want to work

Yes, after deleting the files package_index.json and package_index.json.sig Arduino opened normally and all boards are available.

dylanpil commented 4 years ago

@Fernandoantvf Interesting, as several people and myself have done exactly that, which then allows the IDE to open. But when we go to the board manager to add new boards, a red error (java.lang.nullpointerexception ) at the bottom of board manager appears, and not all boards for installing appear in the board manager. Are you 100 percent sure you went into the board manager menu?

dylanpil commented 4 years ago

see forums @ https://forum.arduino.cc/index.php?topic=324095.0 https://forum.arduino.cc/index.php?topic=661342.105

mjfos2r commented 4 years ago

@Fernandoantvf did you go to board manager? as this is one part that just doesnt want to work

Yes, after deleting the files package_index.json and package_index.json.sig Arduino opened normally and all boards are available.

works similarly with deleting the package_index files but any attempt to reopen board manager results in the aformentioned bug. I also can't access any boards that aren't locally installed. I'll also add I'm specifically trying to work with an ESP8266

fpistm commented 4 years ago

Seems the json was corrupted. Removing the package_index.json and package_index.json.sig solves the issue as suggested by @Fernandoantvf. Thanks

Fernandoantvf commented 4 years ago

@Fernandoantvf Interesting, as several people and myself have done exactly that, which then allows the IDE to open. But when we go to the board manager to add new boards, a red error (java.lang.nullpointerexception ) at the bottom of board manager appears, and not all boards for installing appear in the board manager. Are you 100 percent sure you went into the board manager menu?

@dylanpil Sorry, my mistake,if I open the board manager I get the NullPointerExeption, however, all my boards are listed, perhaps because I have installed the manually.

suyy10 commented 4 years ago

I'm facing the same issue after installing arduino 1.8.12 then install esp8266.

However, I resolved the issue by:

  1. update java to 1.8.0_251
  2. Delete C:\Users\xx\AppData\Local\Arduino15\package_index.json
  3. Uninstall and re-install arduino
Wally-B commented 4 years ago

Good I found this. I was in the middle of coding/testing and the issue started. It looks like windows did an update on my machine. Wasn't sure if it was Windows, Java, or ??? I didn't want to take any chances and started extra backups of all my work. Hope this get fixed. Thanks to everyone for posting and restoring my sanity.

dergizzle commented 4 years ago

@suyy10 if you now open board manager, does it work or does it throw a nullpointer and IDE won't start again?

cmaglie commented 4 years ago

We had a problem on our package_index.json that caused the error and prevented the IDE to start. Now the package_index has been fixed, but to recover a working installation you must delete once again the package_index.json with the cache folder and restart the IDE as usual.

Windows:

Mac:

Linux:

Please note that the problem that prevents the IDE to start has already been fixed and it's ready for the next release, that's the reason why the Nightly/Beta Builds are not affected, and also the reason why we did not detect this problem earlier, sorry about that!

dylanpil commented 4 years ago

I have found that if you

  1. Uninstall Arduino IDE
  2. Delete C:\Users\xx\AppData\Local\Arduino15
  3. install ARDUINO 1.8.10 everything seems to work fine. or
  4. Uninstall Arduino IDE
  5. Delete C:\Users\xx\AppData\Local\Arduino15
  6. download ARDUINO NIGHTLY (arduino-nightly-windows.zip)
  7. run Arduino from executable arduino file Everything seems to work. I was getting a Index Error: when going to the boards manager, but that seems to have disappeared. That could be because I now have ARDUINO 1.8.10 installed with the correct files in there. I was wondering about copying this ones package_index.json (and possibly other files too) and replacing the one ARDUINO 1.8.12 creates, to hopefully get ARDUINO 1.8.12 to work.
dylanpil commented 4 years ago

@cmaglie I tried removing the whole folder from Windows: C:\Users\YourUsername\AppData\Local\Arduino15 this only got the GUI working again. are you implying if i re-download the ARDUINO 1.8.12 again and on Windows:

then ARDUINO 1.8.12 will work?

JCT250 commented 4 years ago

So to try and narrow down root cause..

Doesn’t look like anyone on *nix or Mac operating systems are having any issues with 1.8.12? Only windows?

I had a look at the windows updates that have been installed automatically on my pc recently and the most recent one was on the 6th of June.. The last one before that was mid May. What do other people see re windows updates?

infolog-tracking commented 4 years ago

I think they fixed it...

dergizzle commented 4 years ago

@cmaglie already gave the statement, as i suspected it was a central problem and nothing related to OS or Java. This should really be tested better before rolling out though ...

dylanpil commented 4 years ago

I have just reinstalled ALL GOOD!!!!!!!!!!!!

suyy10 commented 4 years ago

@dergizzle board manager is working and esp8266 is installed on arduino 1.8.12.

dergizzle commented 4 years ago

@suyy10 Yes I read your first repsonse, note that they fixed the underlying, central problem - which is why it is now working properly.

krissastrabudi commented 4 years ago

yes it's working now. I just tried to download 1.8.12 from https://www.arduino.cc/en/main/software and its all working normal now

cmaglie commented 4 years ago

@cmaglie already gave the statement, as i suspected it was a central problem and nothing related to OS or Java. This should really be tested better before rolling out though ...

Yes, this is totally our fault, we tested the package_index.json on the IDE master that didn't show the problem and we thought it was ok. We have to refine our testing procedure to avoid this problem to happen again.

For people looking for the "solution" here the comment -> https://github.com/arduino/Arduino/issues/10332#issuecomment-641830310

darshit115 commented 4 years ago

Hey friends, Issue is resolve. Its start working.

Wally-B commented 4 years ago

All good. (Windows 10 User) Happened in the middle of Debugging HW/SW which made it double whammy confusing. Sanity back!! Thanks so much !!

rbaumann commented 4 years ago

Linux:

remove file /home/YourUsername/.arduino15/package_index.json
remove folder /home/YourUsername/.arduino15/cache

Worked great for me, thanks a lot!!

Bharath-M-R commented 4 years ago

We had a problem on our package_index.json that caused the error and prevented the IDE to start. Now the package_index has been fixed, but to recover a working installation you must delete once again the package_index.json with the cache folder and restart the IDE as usual.

Windows:

  • remove file C:\Users\YourUsername\AppData\Local\Arduino15\package_index.json
  • remove folder C:\Users\YourUsername\AppData\Local\Arduino15\cache

Mac:

  • remove file /Users/YourUsername/Library/Arduino15/package_index.json
  • remove folder /Users/YourUsername/Library/Arduino15/cache

Linux:

  • remove file /home/YourUsername/.arduino15/package_index.json
  • remove folder /home/YourUsername/.arduino15/cache

Please note that the problem that prevents the IDE to start has already been fixed and it's ready for the next release, that's the reason why the Nightly/Beta Builds are not affected, and also the reason why we did not detect this problem earlier, sorry about that!

This is working one..Thanks

efrankx commented 4 years ago

Many Thanks for fixing the problem!

carryonrewardless commented 4 years ago

"Doesn’t look like anyone on *nix or Mac operating systems are having any issues with 1.8.12? Only windows?"

Nope. I had the problem on Ubu 18.04.3 firstly with version 1.8.7 and then on a new install of 1.8.12 when trying to troubleshoot. Can confirm that deleting cache and package_index.json also allows the IDE to re-start.

Gandboss commented 4 years ago

Thanks for fixing - have a coffee on me :-) G

adamalfath commented 4 years ago

Removing cache and package index works for me (https://github.com/arduino/Arduino/issues/10332#issuecomment-641832820). Last time I open IDE in poor network and getting error to retrieve board package (forgot the exact message), currently I'm adding esp32, esp8266, tennsy and stm32 board. Maybe it has something to do with that? failed to rollback?

rjs5327 commented 4 years ago

This is all great feedback, So what needs to be done is a script need written to auto repair the issue if the package_index is the primary issue. I removed it on the one machine and V1.8.12 is back and running.

So on startup we need a try catch statement that if a exception is found that kills the runtime that it catches it and deletes the %APPDATA%\Local\Arduino15\package_Index.json and retrys or closes and the user just trys again.

Also to Developers on the Editor: If we can delete the file and Arduino studio will reinstate it why not just delete it on closing as a patch to the bug? What is the purpose of the file? Since the studio is clearly querying the hardware folders.

matthijskooijman commented 4 years ago

So on startup we need a try catch statement that if a exception is found

Something like this is already implemented in the git master branch (better exception handling, so server-side problems will not prevent further startup), but this was just not released yet. So 1.8.13 (when it is released) should handle all this more gracefully.

If we can delete the file and Arduino studio will reinstate it why not just delete it on closing as a patch to the bug?

That would probably cause additional unnecessary downloads and prevent some boards from working when you have no internet connection. It would probably not solve the original problem either (since the file is then redownloaded on startup, which would yesterday just redownload the corrupt file and then bail out).

fere commented 4 years ago

Im use Linux Mint. Arduino IDE 1.8.12. Erron on run IDE: **Picked up JAVA_TOOL_OPTIONS: Set log4j store directory /home/username/.arduino15 java.lang.NullPointerException at cc.arduino.contributions.packages.ContributionsIndexer.parseIndex(ContributionsIndexer.java:134) at processing.app.BaseNoGui.initPackages(BaseNoGui.java:483) at processing.app.Base.<init>(Base.java:273) at processing.app.Base.main(Base.java:150)** On run or SU user IDE normal starting. Im delete 2 files package_index.json and package_index.json.sig in /home/username/.arduino15 folder. Now Arduino IDE run is nornal.

alex-gab commented 4 years ago

I am on Ubuntu. In order to fixed the issue (java.lang.NullPointerException), I just backed up my settings folder: mv ~/.arduino15/ ~/arduino15_bak Arduino IDE launched successfully after that. I have lost my settings (board, processor, port), but it was easy to re-apply them in my case.

quangchungnguyen commented 4 years ago

Simply is delete all files and folders in "\AppData\Local\Arduino15" directory. After that start Arduino IDE.

3mc2 commented 4 years ago

Same Issue, Was working yesterday, today it would not start. Reinstalled the app 1.8.12 which is what was running prior. Splash comes up then nothing. Run the debug and I get same java error

Followed what @Bharath-M-R stated. It is working now.

leoncoolmoon commented 4 years ago

del C:\Users\xxxx\AppData\Local\Arduino15\package_index.json

avnamer commented 4 years ago

We had a problem on our package_index.json that caused the error and prevented the IDE to start. Now the package_index has been fixed, but to recover a working installation you must delete once again the package_index.json with the cache folder and restart the IDE as usual. Windows:

  • remove file C:\Users\YourUsername\AppData\Local\Arduino15\package_index.json
  • remove folder C:\Users\YourUsername\AppData\Local\Arduino15\cache

Mac:

  • remove file /Users/YourUsername/Library/Arduino15/package_index.json
  • remove folder /Users/YourUsername/Library/Arduino15/cache

Linux:

  • remove file /home/YourUsername/.arduino15/package_index.json
  • remove folder /home/YourUsername/.arduino15/cache

Please note that the problem that prevents the IDE to start has already been fixed and it's ready for the next release, that's the reason why the Nightly/Beta Builds are not affected, and also the reason why we did not detect this problem earlier, sorry about that!

This is working one..Thanks

work for me! Thanks a lot

aidtopia commented 4 years ago

I updated to 1.8.12 yesterday and it worked fine all afternoon. Last night I got a Windows 10 update, and this morning I'm getting the same stack trace, so perhaps it's related to the OS update. Winver currently reports Version 1909 (OS Build 18363.900) with a copyright year of 2019.

I'll try the workarounds listed above.

JPaulMora commented 4 years ago

Hey I just got this error. For a simple fix just move your current ~/Library/Arduino15 folder and let the app rebuild it.

# One liner
mv ~/Library/Arduino15  ~/Library/Arduino15-bak && open /Applications/Arduino.app
matthijskooijman commented 4 years ago

I'm closing this issue, the primary issue (and official solution) is here: #10345.

jmgandarias commented 4 years ago

Linux:

remove file /home/YourUsername/.arduino15/package_index.json
remove folder /home/YourUsername/.arduino15/cache

Worked great for me, thanks a lot!!

Worked for me too (Ubuntu 20.04)

rubenwardy commented 4 years ago

Sorry for the bump: For those using an arch linux distro, you need to install arduino-avr-core