Running on emulator


I am running my app on real devices just fine, but when I fire it up on the emulator it crashes with this message:

E/AndroidRuntime: FATAL EXCEPTION: main
Process:, PID: 6747
java.lang.RuntimeException: Unable to retrieve device. Invalid device ID.
at com.backendless.async.callback.BackendlessCallback.handleFault(
at com.backendless.async.message.AsyncMessage$FaultHandler.handle(
at com.backendless.async.message.AsyncMessage.handleCallback(
at com.backendless.core.AndroidCarrier$1.handleMessage(
at android.os.Handler.dispatchMessage(
at android.os.Looper.loop(
at java.lang.reflect.Method.invoke(Native Method)

As this crash happens outside of my code, how can I resolve it? I want to prevent it from occurring on other devices. Is the problem that the Play Services are missing (they are missing indeed on that instance). And when I run it on my emulator with Play Services enabled, it works.

What exactly is it depending on? Can I expect your code to be running when a device can access my app through Google Play Store? (Because then they would have Play Services enabled, right?)

Thanks for your support
Felix D.


Check in the debugger is the following value is set:

If not, you can assign a value to that variable before making any of the API calls.


Okay so I guess I have to create a unique device ID first, right? What are the best practices for that, and why doesn’t the API do that for me? Is all of that somehwere in the docs?

Backendless assigns one as you can see in the code right here:

However, I would like to rule out that something went wrong in that logic and that is why I asked you to check in the debugger if the value is set.


actually … although having nothing changed the App now works. I mean I will not complain, but I am sorry for bothering you. I’ll let you know when it comes back one day. In that case: should I comment here or create a new question?

Thanks anyways (and for the links)! :slight_smile:

Felix D.