Particle Dev: Build didn't produce binary Error

Hello folks,

Starting today, code that I was able to successful compile yesterday it is failing to do so today. I’m compiling on the cloud.

Particle Dev gives me a truncated error that says:
Build didn't produce binary Error: Command failed: /spark/c...

I read some other threads and I can confirm that there are no other ino files in the build directory.

I’m able to compile simpler smaller programs. But the one I’m trying to compile (the binary was around 100k) fails to do so.

During yesterday’s upgrade to the compiler, was there a size limit, or compilation time out limit implemented?

Any other ideas of what could be causing this error?

Thanks!

Hi,

I have same error today with code that worked few days ago.
My binary was 77k.

I have UHD resolution and if I maximize Particle Dev window, I can see error:
Build didn’t produce binary Error: Command failed: /spark/compile_service/shared/workspace/6_photon_0.4.6_19_1/firmware/…

Maybe there is just problem on the server side.

SOLVED

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 = "000.000.000.000";
...
Particle.variable("PublicIP", varMyIP, STRING);

look here:

you'll want to use a C string

2 Likes

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.

Hi,
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…