1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Flutter] How to fix the error ClientException with SocketException

Discussão em 'Mobile' iniciado por Stack, Novembro 4, 2024 às 12:02.

  1. Stack

    Stack Membro Participativo

    I have a Flutter application that extracts data ( http.post(url) ) from a MySql table using a PHP script. It works perfectly.

    For a few days now, if I recompile the application, it gives me this error when I launch the apk: "Error: ClientException with SocketException: Host search failed: 'www.miosito.it (Operating system error: No address associated with the host name, errno= 7), url=https: //www.miosito.it/script/prova.php".

    But if I run it with the emulator it works perfectly.

    (

    My configuration is this:

    Flutter (Channel stable, 3.24.3, on Microsoft Windows [Version 10.0.19045.5011], locale it-IT)

    Windows Version (Installed version of Windows is version 10 or higher)

    Android toolchain - develop for Android devices (Android SDK version 35.0.0)

    Chrome - develop for the web

    Android Studio (version 2024.1)

    I created a very simple new page where I call a PHP script that basically does nothing and just responds 'OK'. Same error. It works with the emulator but when compiled it doesn't.

    I did all the tests and checked all the permissions on AndroidManifest.xml. I also tried replacing

    If I launch the script from the browser it works perfectly.

    It seems like once filled out it can't resolve the address. I also reinstalled AndroidStudio, Flutter etc.. on a new machine but nothing changed.

    Continue reading...

Compartilhe esta Página