Can t make my android app run a function on my photon

Hi i am tinkering with the android example app.I can read a variable from photon but i cant run a function on my photon.I am using the code from particle docs:
int resultCode = someDevice.callFunction(“digitalwrite”, list(“D7”, “1”));
in my case I have a function led which takes a parameter on,off to turn on/off photon 's led.
my code is
int resultCode = someDevice.callFunction(“led”, list(“on”));
I get an exception FunctionDoesNotExist
Help anyone?

@ido @jensck any thoughts?

That error is exactly what it sounds like: according to the last update from the Particle cloud, there was no such function found on that device! :slight_smile:

If you retrieve the raw JSON for that device with curl, does the “led” function appear in the list of functions?

curl does work fine and so does IFTT

I had this same error and just solved it. I needed to call the function inside a try/catch. For example

                try {
                    device.callFunction("toggle");
                } catch (ParticleDevice.FunctionDoesNotExistException e) {
                    e.printStackTrace();
                }

This may be too late for you, but hopefully it can help someone else.