Flutter - Unhandled Exception: SocketException: - flutter

I am facing below error while accessing the web services in android app. But its working fine in iOS app.Pl help us to resolve this issue
[ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: SocketException: OS Error: Connection refused, errno = 111, address = localhost, port = 47992

Also I have faced the same problem.
The way I have solved my problem is,
I made sure that there is no error in my code. Then I uninstalled my app, after that I restarted my phone and install the app again. Then it start working.
I hope this will help..

Related

facing socket exception in flutter(warning in console),error no-111

I am trying to enter into my flutter app and it is showing this error,infact api is also working fine and getting the right response.but still facing
SocketException: OS Error: Connection refused, errno = 111, address = "", port = 50000

Flutter - Socket.Connect() - SocketException: OS Error: Connection timed out

When I was working on debug mode (with "flutter run") by using my device (real), Socket.Connect() method doesn't work.
Also I would like to say that this Connect method is in "dart:io" library.
In shortly;
I opened a server (TCP) with Python.
I wrote the Flutter client like below to be able to connecting to the server in Python.
Future den() async {
print("Started");
Socket sock = await Socket.connect("192.168.0.159", 5431);
print("Done +++++++++++++++++++++++++"); }
However, I took a SocketError as Connection time out.
The error message I took:
E/flutter (17655): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: SocketException: OS Error: Connection timed out, errno = 110, address = 192.168.0.159, port = 43836
NOTE:
I tried to change the manifest file by adding INTERNET permission, but it is not working.
It was a strange problem, because there is no problem the code I shared. Windows Defender performed a rule to block to open a port as server. Hence, I started the server on my machine, however, I couldn't connect it from my Android device.
Maybe, the error code that is shown by Flutter isn't clear. If you took a error about socket programming for connection or binding, looking to Defender (or firewall) can be affective method. Unfortunately, as I was just starting to learn Flutter, I thought of checking out Defender afterwards.

problem with flutter and mongodb connection

import 'package:mongo_dart/mongo_dart.dart';
main() async{
Db db = new Db("mongodb://localhost:27017/workouts");
await db.open();
print("success ---------------------------------");
}
this symple code and dont connect, i dont know why.
this is the output:
Syncing files to device Android SDK built for x86...
Restarted application in 306ms.
E/flutter ( 5415): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: SocketException: OS Error: Connection refused, errno = 111, address = localhost, port = 52206
E/flutter ( 5415): #0 _ConnectionManager._connect (package:mongo_dart/src/network/connection_manager.dart:23:5)
....
and more logs
¿some help? :(
solved ==> https://stackoverflow.com/a/55786011/12369361
due to use emulator I need to use 10.0.2.2 instead of localhost
I suppose that you have a local mongoDB server. If it is the case, you have to connect your local server and your android phone to the same network (through wifi).
Then get the IP of your local server and replacing localhost in your url with the IP you found.
If you can't, it is possible that your firewall is blocking your requests.

Exception: ideviceinfo returned an error: ERROR: Could not connect to lockdownd, error code -17

I tried install flutter on my mac but these error always show up :
⢿Unhandled exception:
Exception: ideviceinfo returned an error:
ERROR: Could not connect to lockdownd, error code -17
can anyone help me?
I've tried many ways but the error always show up.
I think it is caused by having an iOS device plugged in to your computer. I had the same issue and it went away after unplugging my phone. You won't get this message if the device is plugged in and the computer is marked as a trusted device.

Uncaught CurlException: 7: Failed to connect

I have a live facebook application. Starting from last week, I keep getting
PHP Fatal error: Uncaught CurlException: 7: Failed to connect to 2a03:2880:2110:3f03:face:b00c:0:1: Network is unreachable
It is thrown in base-facebook.php file in facebook sdk 3.1.1 (Using the latest version)
What could be the cause?
Thanks in advance.
Maybe,you should check Network settings for IPV6.
at My application , Error continued to occur .
Setting up the network and Programming has not changed.
So , I've change Network settings for IPV6. I've solved it.