Particle Dev: Build didn't produce binary Error


I found this post:

My code had: "Spark.variable(“result”, &resultstr, STRING);"
I changed it to “Spark.variable(“result”, resultstr, STRING);” and compile started to work!

1 Like

@photonizer, glad you found your error in the code.

It would be nice if Particle Dev generated a less cryptic response!

I don’t know if Particle Dev is current with the latest firmware release. @suda ?

There is a bug open on the lack of detail in compiler errors when using Particle-Dev. I think @mdma is working it. Bug #79 and #110 are both related.

@photonizer, @sazp96

Just to be prepared if some other “cryptic” messages pop up in future, due to the transition from :spark: Spark.IO to :particle: Particle.IO a while back the keyword Spark will be deprecated and changed over to Particle.
So try to already replace things like Spark.function() with Particle.function() - currently it should work both ways on the Core but I don’t think the old version still works on the Photon.

@photonizer, thanks for pointing me out to the variables. As soon as I commented out my string Particle.variable() my code compiled again.

@ScruffR, I have updated all my Spark. to Particle.. It was about time to do it.

Has Particle.variable stop supporting the String class? The code below generates the “Build didn’t produce…” error:

String varMyIP = "";
Particle.variable("PublicIP", varMyIP, STRING);

look here:

you’ll want to use a C string


Just as a side note about String and Particle.variable()

Even if it works at some point it might stop working under some circumstances and errors like that are a hell of a job to find.

1 Like

Thank you @BulldogLowell and @ScruffR. I will do the switch to C string.

I’m trying to run from Particle Dev, a software on the Photon, but I’m getting the “Build didn’t produce binary error”. How Can I fix it? The software is .ino extension.

There are a few things that can cause this error.

One that we keep bumping into is the size of our binary. How many kb was the last binary you were able to compile? If your new binary is greater than 128kb you would get this error.

Another cause of “Build didn’t produce binary” with no error listed is that the directory containing the .ino file contains more than one .ino file. It doesn’t just build the file you have open, it builds all of the .cpp and .ino files in that directory so you can use libraries.

And a number of other reasons discussed in the forum.

Usual response:
Provide more background, code, screenshot, … to save us from needing to guess around :crystal_ball:

Just a few
Particle Dev won't build, particle-cli will
Particle Dev: "build didn't produce binary"
Particle Dev with multiple projects - what?
Particle dev will not compile
Particle Dev objbase.h no such file Cannot compile

Mostly the same reasons :wink:

1 Like

Thank you for your reply. In my project there a some different library, so I have multiple cpp and h file, with just one .ino file. I always get that problem…

I had this same problem today and after I chose a device, the error went away. For those with no compile problems perhaps this would help with your issue.

I had this problem and the actual issue was a particle.function with too long of a name (12 character max). Hope this helps someone.

What version were you targeting?
AFAIK with more recent versions you should get an explicit warning/error when providing too long names.
If this wasn’t the case with the most recent version, we might have found a regression.

But I do get

In file included from ../wiring/inc/spark_wiring.h:48:0,
                 from ./inc/application.h:36,
                 from _inttest.cpp:2:
../wiring/inc/spark_wiring_cloud.h: In instantiation of 'static bool CloudClass::function(const T&, Types ...) [with T = char [14]; Types = {int (*)(String)}]':
_inttest.cpp:25:41:   required from here
../wiring/inc/spark_wiring_cloud.h:188:9: error: static assertion failed: 

In Particle.function, name must be less than 12 characters

Although it should actually be In Particle.function, name length must be equal or less than 12 characters

I was targeting 0.5.3

I’m also getting this error, using an brand new Electron 2G. When I click on the message, Particle-dev tells me “There were no compile errors.” My project has a .cpp and .h file in the project directory alongside my .ino file, which has a #include “mylib.h” at the top of it.

Using Particle-dev to comipe and generate a binary seems to work fine on a trivial stand alone .ino file in its own directory (i.e. with an empty setup and loop).

Are multi-file projects just not yet supported in Particle-dev? This documentation would lead me to believe it was…

Yes, they are supported.
Can you post a screenshot of the full Dev window?

@ScruffR yea sure, mildly santized…

It must be something about the actual contents of my project but when I click on the red text in the bottom bar of the screen shot above, this pops up, which makes it seem like there’s no problem.

I can, nevertheless download the binary from the Cloud IDE without issue.