-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Closed
Labels
impact: crowdAffects many people, though not necessarily a specific customer with an assigned label. (P2)Affects many people, though not necessarily a specific customer with an assigned label. (P2)plugin: messagingtype: bugSomething isn't workingSomething isn't workingtype: documentationImprovements or additions to documentationImprovements or additions to documentation
Description
Describe the bug
Since updating my app to the Android v2 embedding I've been getting reports in Crashlytics concerning ensureInitializationComplete must be called after startInitialization io.flutter.embedding.engine.loader.FlutterLoader.ensureInitializationComplete
.
The Flutter 1.12 upgrade guide says to remove all references to the startInitialization
or ensureInitializationComplete
methods but I see 2 references to these methods: here and here.
To Reproduce
Steps to reproduce the behavior:
- Upgrade app to v2 embedding.
- Start app and then close it.
- Send notification from the Firebase Notification Composer.
- Notice app crash notification on device.
- See error or incorrect behavior
I have not seen the issue when I leave the app open and send the notification.
Expected behavior
Notification displayed normally while app is closed.
Additional context
Here is what the Crashlytics report looks like:
Fatal Exception: java.lang.RuntimeException
Unable to create service io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService: java.lang.IllegalStateException: ensureInitializationComplete must be called after startInitialization
android.app.ActivityThread.handleCreateService (ActivityThread.java:3746)
android.app.ActivityThread.access$1400 (ActivityThread.java:235)
android.app.ActivityThread$H.handleMessage (ActivityThread.java:1784)
android.os.Handler.dispatchMessage (Handler.java:106)
android.os.Looper.loop (Looper.java:214)
android.app.ActivityThread.main (ActivityThread.java:6986)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:494)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1445)
Caused by java.lang.IllegalStateException
ensureInitializationComplete must be called after startInitialization
io.flutter.embedding.engine.loader.FlutterLoader.ensureInitializationComplete (FlutterLoader.java:153)
io.flutter.view.FlutterMain.ensureInitializationComplete (FlutterMain.java:80)
io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService.onCreate (FlutterFirebaseMessagingService.java:71)
android.app.ActivityThread.handleCreateService (ActivityThread.java:3734)
android.app.ActivityThread.access$1400 (ActivityThread.java:235)
android.app.ActivityThread$H.handleMessage (ActivityThread.java:1784)
android.os.Handler.dispatchMessage (Handler.java:106)
android.os.Looper.loop (Looper.java:214)
android.app.ActivityThread.main (ActivityThread.java:6986)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:494)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1445)
sgehrman, Knupper, W2YAdmin, DavidKuennen, JanKn and 77 moreViniciusSossela, jdeltoft and rogiervandenbergViniciusSossela, aaalekseev, pablanka, jdeltoft and rogiervandenberg
Metadata
Metadata
Assignees
Labels
impact: crowdAffects many people, though not necessarily a specific customer with an assigned label. (P2)Affects many people, though not necessarily a specific customer with an assigned label. (P2)plugin: messagingtype: bugSomething isn't workingSomething isn't workingtype: documentationImprovements or additions to documentationImprovements or additions to documentation