Spark Dev: app code was invalid

Hello,
I’m trying to use the Spark Dev Mac app (latest release) to upload code. However, anytime I try to compile the code, I get an error at the bottom which says “App code was invalid.” When i clicked on it, the panel that shows up at the top said no compile errors. I tried this with the blink program that comes with the core, and it did not work as well.

Thanks,
Mihir

same problem over here (Macbook Pro Retina 13 (mid2014))

Same here, using Windows 8.1 64Bit :frowning:

Yes, same issue. Windows 8.1 64bit

EDIT: Autodetect defaults to plain text so I need to manually select C++ to get syntax highlighting. After compile it goes back to plain text.

Great feedback! Can you send a feedback via the Spark dev or open an issue at https://github.com/spark/spark-dev? :slight_smile:

Were you able to get it to compile and upload this way, @arniew?

@ mihirt - compile and upload ‘what’ way? Do you mean saving to a clean folder? I tried that but it still does not work. I’ve also tried some basic code ‘Blink LED’ without referencing libraries.

I had the same problem.
But I think it’s because you have more files in your project directory.

Try moving the files of your project in one folder, (only the ones you need, libraries, etc.)
Then restart the SparkDev Editor, and now open your file from the new directory.

This worked for me.

I notice you can’t even use any directories under the root, just your .ino and all your libs .cpp and .h files need to be under the root folder for it to compile, at least on the mac version that appears to be the case.

@mihirt, in your screenshot it appears the file is correctly named, but you will get the same generic error if the sketch is not saved with a ‘.ino’ extension.

Also, there can be only a single .ino file in the directory. The compiler seems to be quite picky about the file system structure, as also pointed out by rog3r and mtnbrit.

Is there a fix for this yet? I just realize I am also facing this problem on my windows 8.1 64bit. Currently using the web version to do it. =/

@Leonardo are your files either .cpp or .h files? I get this error only if I don’t have them properly extension-ed

I only have a .ino for the core. I do not have any #includes.

Just to humor me would you mind renaming the .ino to a .cpp?

@harrisonhjones I was about to do that hahaha. But anyway it is working for me already. Reading @cayuse and @rog3r posts I realize that even .html or .js files cannot be inside as well.

The folder must be plain empty except for the .ino file that I am using… Really very picky program hahaha.

1 Like

I had also the same problem, solved in the same way. I use git as version control of my code, but it didn’t work until I moved it to new folder without the .git files.

Any idea how to use git version control without interrupt Spark dev to compile and flash?

By the way, I am using win7, so it’s not just win8/win8.1 problem.

Hi @matan I am not too sure about .git files. :x I always do this normal #includes like

#include "flashee-eeprom.h"

I’m able to get simple projects working if I create a folder call “Projects” in my Spark Dev folder. I then save the files to that folder and put the extension .ino at the end of the saved file manually.

.cpp gives a zillion errors and .h flashes but nothing happens.

A clean directory is needed like it is stated here above… The bad ugly thing is that it makes it hard to keep version control for git… Since git uses directories inside the project directory!!!

Ran into this issue. Would love to see it fixed.