Skip to content

Board Manager Update results in java.lang.NullPointerException #11131

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
bdlabitt opened this issue Jan 4, 2021 · 2 comments
Open

Board Manager Update results in java.lang.NullPointerException #11131

bdlabitt opened this issue Jan 4, 2021 · 2 comments
Labels
Component: Board/Lib Manager Boards Manager or Library Manager Type: Bug

Comments

@bdlabitt
Copy link

bdlabitt commented Jan 4, 2021

IDE 1.8.13, Platform linux64, Ubuntu 20.04.1
Have not be able to update boards using board manager. This error is the same as reported #10335 (and closed) last year. The apparent solution does not appear to be robust, since it has reoccured. I cannot update the Arduino SAMD board support package. Currently at 1.8.9. Clicking update results in the error.

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

Is the solution still to delete .arduino15/cache/cache.json and ./arduino15/package_index.json and restart the Arduino IDE, as stated by facchinm on June 10, 2020?

@bdlabitt
Copy link
Author

bdlabitt commented Jan 4, 2021

No, to answer my question, this fix does not work. Renaming the above files, does not fix the error.

@matthijskooijman
Copy link
Collaborator

I think this is a completely different problem. The NullPointerException error is just a generic indication that some variable is null when it shouldn't be, and looking at the backtrace, the cause is completely different.

Looking at the backtrace, the exception is caused here:

log.info("The directory is not empty there is another version installed. directory {}",
destFolder.getParentFile().toPath(), e);

Called from here:
errors.addAll(installer.remove(platformToRemove));

So it seems it's either destFolder that is null, or destFolder.getParentFile() is null (I think getParentFile() can return null when destFolder is already the root path / or maybe an empty path).

I haven't dug further, so I have no advice on what could cause this or how to work around this, but hopefully the above helps others to figure out what's going on...

@per1234 per1234 added Component: Board/Lib Manager Boards Manager or Library Manager Type: Bug labels Mar 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Board/Lib Manager Boards Manager or Library Manager Type: Bug
Projects
None yet
Development

No branches or pull requests

3 participants