java.lang.NullPointerExceptionjava.lang.RuntimeException: java.lang.NullPointerException at cc.arduino.contributions.packages.ui.ContributionManagerUI.lambda$onUpdatePressed$19(ContributionManagerUI.java:151) at java.lang.Thread.run(Thread.java:745)Caused by: java.lang.NullPointerException at cc.arduino.contributions.packages.ContributionsIndex.findPackage(ContributionsIndex.java:49) at cc.arduino.contributions.packages.ContributionsIndexer.syncBuiltInHardwareFolder(ContributionsIndexer.java:197) at cc.arduino.contributions.packages.ContributionsIndexer.syncWithFilesystem(ContributionsIndexer.java:187) at processing.app.BaseNoGui.initPackages(BaseNoGui.java:626) at processing.app.Base$9.onIndexesUpdated(Base.java:1307) at cc.arduino.contributions.packages.ui.ContributionManagerUI.lambda$onUpdatePressed$19(ContributionManagerUI.java:149) ... 1 morejava.lang.NullPointerException at cc.arduino.contributions.packages.ContributionsIndex.findPackage(ContributionsIndex.java:49) at cc.arduino.contributions.packages.ContributionsIndexer.syncBuiltInHardwareFolder(ContributionsIndexer.java:197) at cc.arduino.contributions.packages.ContributionsIndexer.syncWithFilesystem(ContributionsIndexer.java:187) at processing.app.BaseNoGui.initPackages(BaseNoGui.java:626) at processing.app.Base.openBoardsManager(Base.java:1325) at processing.app.Base$10.actionPerformed(Base.java:1348) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259) at javax.swing.AbstractButton.doClick(AbstractButton.java:376) at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:833) at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:877) at java.awt.Component.processMouseEvent(Component.java:6535) at javax.swing.JComponent.processMouseEvent(JComponent.java:3324) at java.awt.Component.processEvent(Component.java:6300) at java.awt.Container.processEvent(Container.java:2236) at java.awt.Component.dispatchEventImpl(Component.java:4891) at java.awt.Container.dispatchEventImpl(Container.java:2294) at java.awt.Component.dispatchEvent(Component.java:4713) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466) at java.awt.Container.dispatchEventImpl(Container.java:2280) at java.awt.Window.dispatchEventImpl(Window.java:2750) at java.awt.Component.dispatchEvent(Component.java:4713) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758) at java.awt.EventQueue.access$500(EventQueue.java:97) at java.awt.EventQueue$3.run(EventQueue.java:709) at java.awt.EventQueue$3.run(EventQueue.java:703) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) at java.awt.EventQueue$4.run(EventQueue.java:731) at java.awt.EventQueue$4.run(EventQueue.java:729) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76) at java.awt.EventQueue.dispatchEvent(EventQueue.java:728) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
documentation is not great
Boards Manager Support File Locations on GitHub - I also found this page that discusses various places you can host your json file on GitHub, but I think this is a topic that represents one of the last steps rather than the first.
Let's say I want our board to compile with avr-gcc 4.8.1. Do I need to maintain and update my own version/download of the compiler or can I simply refer to this somewhere at Arduino.cc?
what is the difference between 4.8.1-arduino2 and 4.8.1-arduino5?
I imagine it is easier to help someone correct a thing they have already created, than to help someone create something that doesn't yet exist.
Then I open Boards Manager and get a java.lang.NullPointerException error
This folder structure is different from the one required for manual installation. Some people can't use Boards Manager due to network security settings, etc. so it's nice to still offer the option of easy manual installation. So it may be more convenient to set up the repository folder structure for manual installation and then create your own Boards Manager archive file with the correct folder structure at each release.
So the options are to just state that the package is not compatible with Arduino IDE 1.6.10 or to change the JSON file so that your package uses its own avr-gcc tool instead of using the arduino tool. You can still have the file downloaded from their server.
Arduino has their own custom builds of avr-gcc. so the 4.8.1 is the official avr-gcc release version and the -arduino5 is the revision of the Arduino build.
Nevertheless, my brain tumors have not been too painful yet
Looking at Sparkfun and others it doesn't appear most actually do provide the correct folder for manual installation? Sparkfun's layout, which I copied, has this folder structure in their GitHub repository: sparkfun\avr\stuff...Whereas I would imagine for manual install it should be something like this instead: sparkfun\hardware\avr\1.0.0\stuff...
but perhaps I can align my folder structure to what people will need for manual install, if indeed I have divined that structure correctly.
My concern is related to getting the correct link to Arduino's stash and how to maintain that if they change/upgrade it?
Would one be safe to assume that Arduino is not going to release a version -arduino6?
What I would prefer is to have the JSON tell the IDE "I want to use avr-gcc 4.8.1 and you take care of getting me the best version of that without me having to think about it." But it seems that is perhaps not possible/practical regardless of whether I specify my own tool or use Arduino's.
That is the manual installation folder structure. Manual installation doesn't have the version folder. The Boards Manager folder structure would be sparkfun\stuff because the architecture and version folders are automatically generated during Boards Manager installation based on the information in the JSON file.
I think MCUDude's method would be a good example to use on the Boards Manager Support File Locations on GitHub example page, perhaps replacing Adafruit. Adafruit is a little unusual
I'm also still a relative newbie when it comes to GitHub, so to me the pros/cons of adding another branch aren't really apparent.
What I detect is that branches are perhaps typically intended eventually to be merged
In my JSON I've specified the avr-gcc specifically in the "Tools" section, copying the URLs from Arduino's JSON. I'm not going to host them myself, I'll just use theirs. Hopefully this avoids the bug in IDE 1.6.10.
I did not add avrdude to the "Tools" section, I don't know if that will cause issues in IDE 1.6.10 or not, I'm assuming not.
Big companies like SparkFun and Adafruit have not specified 4.9.2 yet; if they list anything it's 4.8.1. Could this just be a consequence of the hassle of updating your JSON every time Arduino decides to upgrade which seems to be about every five minutes? Or could it be that they prefer the older compiler for some reason I don't know about?[/list]
I also notice that many JSONs don't list any toolsDependencies. Could it be that when this value is left blank the IDE will simply use whatever version is active for the currently loaded AVR Boards, which would be dependent on the IDE version?
Thanks Pert. The next question that naturally arises is, since we are allowed to leave toolsDependencies blank and let the IDE choose the compiler for us, are we therefore also allowed to omit platform.txt from our package? Since platform.txt varies depending on the compiler version and we don't know which version will be used, it would seem this must be so. I've done a test package with toolsDependencies left blank and platform.txt omitted, and all seems to work as it should. But just wanted to make sure this is technically correct, since I don't see others doing this.
Looking at MCUDude's MightyCore repo for example, he leaves toolsDependencies blank, but then he has a platform.txt file
Maybe he doesn't want those new features, or maybe this is a case where he's letting the IDE take care of one decision while not recognizing he should let the IDE take care of the other decisions as well.
Yes, because your package references the arduino:arduino core the Arduino AVR Boards platform.txt will be used if your core doesn't have one or if the platform.txt in your package is incomplete (for example, sometimes a core will have a platform.txt only so the package name can be defined but the rest is left blank since the referenced package's platform.txt works fine).