Flutter Crashlytics SocketException: Reading from a closed socket - flutter

While examining the Firebase crash logs one of our application in production mode, we found the following exception:
Non-fatal Exception: io.flutter.plugins.firebase.crashlytics.FlutterError: SocketException: Reading from a closed socket. Error thrown null.
at _RawReceivePortImpl._handleMessage(_RawReceivePortImpl.java)
That's it, nothing more. How can I set up a more detailed log in Firebase Crashlytics? What could throw such an error? We use websocket, Drift, Dio.
Firebase Crashlytics setup:
FirebaseCrashlytics.instance.setCrashlyticsCollectionEnabled(true);
FlutterError.onError = FirebaseCrashlytics.instance.recordFlutterError;
runZonedGuarded(
() => runApp(const MonitorMobileApp()),
(error, stackTrace) {
FirebaseCrashlytics.instance.recordError(error, stackTrace);
},
);
Thank you in advance.

Related

FLTFirebaseMessaging: An error occurred while calling method Messaging#getToken, errorOrNil { NSLocalizedFailureReason = "Too many server requests.";}

I had removed my IOS folder and re-added it with flutter create . --platforms iOS .Did this as I was receiving some error and saw this was the solution for it. I tried adding firebase again and I am getting this error:
FLTFirebaseMessaging: An error occurred while calling method Messaging#getToken, errorOrNil => {
NSLocalizedFailureReason = "Too many server requests.";
}
flutter: null
[VERBOSE-2:ui_dart_state.cc(198)] Unhandled Exception: [firebase_messaging/unknown] An unknown error has occurred.
I checked my bundleID it matches exactly and I added google service info plist file.
I have to done these steps multiple times but still receive this error.
Any suggestions regarding this will be greatly appreciated.App working completely fine on android

Using msal_mobile with Flutter

When runing the MsalMobile example i have this error :
[ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: Instance of 'MsalMobileException'
Help me please
This question is incomplete. You need to identity the exact error causing the exception. Try catch will help you do that, check out the official docs for error handling here

Firebase Crashlytics record error/log etc not showing on console

The following code errors are not showing on firebase console for some reason:
FirebaseCrashlytics.instance.log('This is brilliant log!');
FirebaseCrashlytics.instance.setCustomKey('str_key', 'hello buffallo');
try {
throw 'error_example';
} catch (e, s) {
FirebaseCrashlytics.instance.recordError(e, s);
}
await FirebaseCrashlytics.instance.recordError(
'No error',
StackTrace.empty,
reason: 'a non-fatal error',
);
However, when I force a crash i.e. use
FirebaseCrashlytics.instance.crash()
This shows up fine! Is there something I am doing wrong?
I am using this version in pub spec: firebase_crashlytics: ^0.4.0+1
I can't use the latest version because of some external dependencies (before you ask)
The errors recorded by recordError are listed as non-fatal exceptions in the Firebase console. At least for iOS they are only uploaded when the app was killed and reopened.

Flutter webrtc Failed to set remote answer sdp

I am trying to connect two peer in flutter webrtc but i am getting below error.I am using firebase as a signalling server.
[ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: Unable to RTCPeerConnection::setRemoteDescription: peerConnectionSetRemoteDescription(): WEBRTC_SET_REMOTE_DESCRIPTION_ERROR: Failed to set remote answer sdp: Called in wrong state: stable
I am using below code in listening to the changes in firebase
if (val['t'] == "ans") {
assert(isInitiator);
_peerCon.setRemoteDescription(
RTCSessionDescription(
val['sdp'],
val['tp'],
),
);
return;
}
One peer connection can only set one remote description.
You are trying to setRemoteDescription on a peer with an already established connection. That's why you getting this error.
Check this thread for more details:
Failed to set remote answer sdp: Called in wrong state: stable

How to handle the error "UNet Client Disconnect Error: Timeout"?

How to handle the error "UNet Client Disconnect Error: Timeout"? How not reboot the application, when it occurs?
I now resolve this issue.
I think this can help you too.
myClient.RegisterHandler(MsgType.Error, OnError);
void OnError(NetworkMessage msg){
//Error handler code
}
This Error client receive with "UNET Client Disconnect Error: Timeout".
My solution: If i not have server. I set current client as Server.