Running into error, "Error: Couldn't get GCM token for device"

Please provide the following:

  1. SDK Version: 34
  2. Platforms(Android/iOS/web/all): All

There is a plethora of these threads, but mine is still something I can’t resolve.

I’m using a physical android device.
I’m logged into expo via the CLI
I’m starting my project via expo start

I’ve already gone onto creating a firebase project and copying over the google-services.json, but it doesn’t even reach that part because it can’t get the push notification token.

try {
      console.log("getting token...");
      pushToken = await Notifications.getExpoPushTokenAsync();

      console.log("pushToken", pushToken); // never prints
      . . . . . .
} catch (err) {
      console.log(err); // [Error: Couldn't get GCM token for device]

What can I do here?


Ok so, I knew that this worked on my personal laptop, because I tried to implement it yesterday. Today, it wasn’t working on my work laptop. For the sake of my sanity, I decided to double check on my personal laptop if it still works… and it does. It pulls the push token. Does someone have any idea why this would be? I’ve followed the same steps on both laptops.

I’ve also tried this on my phone’s personal hotspot from both computers to ensure that it’s not a firewall issue.

What could be causing this?

Hey @mkhoussid,

Can you let me know what the different environment variables are between the two laptops (if any)?


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.