[firebase_messaging]: Android getToken() errors lose their cause since firebase-messaging 25.1.0 ("FCM Registration failed!")
Los mantenedores suelen responder en 4 días
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 22/100
Línea de trabajo
Start with the Android side of FirebaseMessaging.getToken() and the Dart error mapping that turns the native exception into firebase_messaging/unknown. Reproduce with the adb steps in the issue, then check how the underlying exception cause is dropped. Pull request #18999 is already open against this, so review it before starting. Done means the native failure reason, such as SERVICE_NOT_AVAILABLE, reaches Dart.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Is there an existing issue for this?
- I have searched the existing issues.
Which plugins are affected?
Messaging
Which platforms are affected?
Android
Description
Since firebase_core 4.11.0 (Firebase Android BoM 34.15.0, firebase-messaging 25.1.0), when the token registration fails, getToken() on Android reaches Dart with the same text, whatever the reason:
[firebase_messaging/unknown] java.io.IOException: FCM Registration failed!
The underlying reason, such as SERVICE_NOT_AVAILABLE or AUTHENTICATION_FAILED, does not reach Dart. Apps can no longer tell a network problem apart from other registration failures.
We see this on many Android devices and versions in production and can't tell the failures apart.
Reproducing the issue
Setup
- Pixel 5, Android 14, Google Play services
- firebase_messaging 16.7.0, firebase_core 4.15.0 (Firebase Android BoM 34.19.0, firebase-messaging 25.1.3)
Steps
- With the device online, call
await FirebaseMessaging.instance.deleteToken(). This removes the cached token, so the nextgetToken()has to register again. - Block network access for Google Play services:
adb shell cmd connectivity set-chain3-enabled true adb shell cmd connectivity set-package-networking-enabled false com.google.android.gms - Call
await FirebaseMessaging.instance.getToken().
Result
After about 30 seconds, getToken() throws:
[firebase_messaging/unknown] java.io.IOException: FCM Registration failed!
The app's logcat has no FirebaseMessaging line about it.
Clean up
adb shell cmd connectivity set-package-networking-enabled true com.google.android.gms
adb shell cmd connectivity set-chain3-enabled false
Then call getToken() again to register a new token.
Firebase Core version
4.15.0
Flutter Version
3.44.9
Relevant Log Output
# getToken() after deleteToken(), Play services blocked
[firebase_messaging/unknown] java.io.IOException: FCM Registration failed!
# FCM's own token sync at app start, same failure
E/FirebaseMessaging: Topic sync or token retrieval failed on hard failure exceptions: FCM Registration failed!. Won't retry the operation.
[firebase_messaging/unknown] java.io.IOException: FCM Registration failed!
Flutter dependencies
Expand Flutter dependencies snippet
firebase_core 4.15.0
firebase_messaging 16.7.0
firebase_messaging_platform_interface 4.10.0
Additional context and comments
No response
- Lenguaje dominante
- Dart
- Estrellas
- 9.3k
- Forks
- 4.1k
- Merge medio
- 4 d 17 h
- PR fusionados (30 d)
- 49
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de firebase/flutterfire
-
[cloud_functions]: Apple platforms ignore custom domains passed as regionPosiblemente ocupada @ragavendranbala-TSL la tomó hoy. AbiertoNeeds Attention platform: ios platform: macos plugin: functions type: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
firebase/flutterfire#19015 · 2 comentarios ·
Los mantenedores suelen responder en 4 días
-
Needs Attention platform: android plugin: messaging type: bug
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
firebase/flutterfire#19017 ·
Los mantenedores suelen responder en 4 días
-
Needs Attention platform: web plugin: crashlytics type: enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 34/100
firebase/flutterfire#19014 · 1 comentario ·
Los mantenedores suelen responder en 4 días
-
[firebase_storage]: Windows: getData() crashes with access violation (use-after-free of StorageReference in ReferenceGetData)Posiblemente ocupada @SelaseKay la tomó hace 4 días. Abiertoblocked: customer-response platform: windows plugin: storage type: bug type: crash
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
firebase/flutterfire#18994 · 2 comentarios ·
Los mantenedores suelen responder en 4 días
-
[firebase_auth_web]: Make the Auth emulator persistence from #18926 configurable instead of hard-gated on kDebugModePosiblemente ocupada @SelaseKay la tomó hace 2 días. AbiertoNeeds Attention platform: web plugin: auth type: enhancement
Dificultad 3/5 1-2 días Aptitud para principiantes 62/100
firebase/flutterfire#18992 · 1 comentario ·
Los mantenedores suelen responder en 4 días
Todos los issues de firebase/flutterfire
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
hajisensai/Fushi#4543 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
[video_player] _updatePosition sets isCompleted=true after 500ms when duration is Duration.zeroAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
dart-lang/dart_style#1928 ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
chriskelly/wish-together#212 ·
Los mantenedores suelen responder en 1 día