Running on emulator

Hello,

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: com.travellers.app.android, PID: 6747
java.lang.RuntimeException: Unable to retrieve device. Invalid device ID.
at com.backendless.async.callback.BackendlessCallback.handleFault(BackendlessCallback.java:28)
at com.backendless.async.message.AsyncMessage$FaultHandler.handle(AsyncMessage.java:83)
at com.backendless.async.message.AsyncMessage.handleCallback(AsyncMessage.java:41)
at com.backendless.core.AndroidCarrier$1.handleMessage(AndroidCarrier.java:37)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6077)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)

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.

Hello,

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.

Regards,
Mark

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.

Hi,

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.