expo: SDK37 Android Expo Client: Couldn't get GCM token on device

šŸ› Bug Report

While running the guide from https://docs.expo.io/versions/v37.0.0/guides/push-notifications, I’m getting the error Couldn't get GCM token on device.

Please run the following project in local expo client to reproduce it https://github.com/yortyrh/pushnandroidissue

Environment

  Expo CLI 3.17.15 environment info:
    System:
      OS: Windows 10 10.0.18362
    Binaries:
      Node: 12.0.0 - D:\Soft\nodejs\node.EXE
      Yarn: 1.19.1 - D:\Soft\Yarn\bin\yarn.CMD
      npm: 6.9.0 - D:\Soft\nodejs\npm.CMD
    npmPackages:
      expo: ~37.0.3 => 37.0.4
      react: ~16.9.0 => 16.9.0
      react-native: https://github.com/expo/react-native/archive/sdk-37.0.0.tar.gz => 0.61.4

This happens in Android using the expo client

Steps to Reproduce

  1. Execute the following steps in windows CMD.
git clone git@github.com:yortyrh/pushnandroidissue.git
cd pushnandroidissue
yarn install
yarn start
  1. Once the application starts, it shows the alert: ā€œError: Couldn’t get GCM token on deviceā€

Expected Behavior

It should show Token: <the push notification token> and no alert

Actual Behavior

It shows Token: <empty> and the Alert: ā€œError: Couldn’t get GCM token on deviceā€

Reproducible Demo

https://github.com/yortyrh/pushnandroidissue

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 23 (11 by maintainers)

Commits related to this issue

Most upvoted comments

Same issue with my production app on Android. Everything seems to be configured correctly : Firebase, key restriction, android.googleServicesFile in app.json and key is showing when I run expo push:android:show,

Hey, sorry for making you run into the issue.

Could you please try this:

  • close Expo Client
  • open Expo Client
  • open this Snack (there’s nothing special about this Snack apart from the fact that it is not an SDK37 experience)
  • go back to Expo Client
  • open your SDK37 app/the app you’re testing this issue on

What does happen then? Opening any experience that is not on SDK37 should help mitigate this bug.

This is changing the issue for expo-client. It is now not resolving the promise. For standalone android application, after configuring firebase it is still the same. Now, looks like the application is somehow reporting to firebase in spite of the issue. Of course, push notifications are not working, but firebase analytics is receiving usage.

Anyway… still not able to receive push notifications even after configuring firebase.

I’m having this issue as well and it crashes the app. Device I’m using is Android Xiaomi Note 7