You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my app, 500~600 users report a _CastError Null check operator used on a null value error at getId().
I'm using the getId() method in RootApp widget's initState function with a Future.microtask:
// this is a pseudo-code, I'm using flutter_hooks and useEffect actuallyvoidmain() {
runApp(RootApp());
}
classRootAppextendsStatefulWidget {
...
}
classRootAppStateextendsState<RootApp> {
@overridevoidinitState() {
super.initState();
Future.microtask(() async {
final installationId =awaitFirebaseInstallations.instance.getId();
print(installationId);
});
}
}
The stack trace looks like this:
_CastError: Null check operator used on a null value
File "method_channel_firebase_app_installations.dart", line 80, in MethodChannelFirebaseAppInstallations.getId
File "<asynchronous suspension>"
...app code...
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
In my app, 500~600 users report a
_CastError Null check operator used on a null value
error at getId().I'm using the
getId()
method in RootApp widget's initState function with aFuture.microtask
:The stack trace looks like this:
What situation may cause this error?
Beta Was this translation helpful? Give feedback.
All reactions