I am running these commands in order to get a token:
InstanceID instanceID = InstanceID.getInstance(getApplicationContext());
String token = instanceID.g
According to official docs:
https://developers.google.com/android/reference/com/google/android/gms/iid/InstanceID#ERROR_MISSING_INSTANCEID_SERVICE
you get this error because
Tokens can't be generated. Only devices with Google Play are supported.
Testing on emulator without Google Play Services enabled/installed?
You need to install the gapps of the version of android in your emulator, if use the genymotion you need to install before the gapps di Genymotion-ARM-Translation_v1.1 after that, probably will work