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

[Flutter] Flutter Phone Application Exception: ClientException with SocketException: Failed...

Discussão em 'Mobile' iniciado por Stack, Novembro 6, 2024 às 04:52.

  1. Stack

    Stack Membro Participativo

    I am getting an error from the API I am using in the application I made in Flutter. It works fine in the web and desktop application, but when I start the phone application, it gives an error.

    Error:


    Exception: ClientException with SocketException: Failed host lookup: 'xxxxxx' (OS Error: No address associated with hostname, errno = 7),

    Code:

    try {
    final response = await http.get(
    Uri.parse(url),
    headers: {
    'Authorization': basicAuth,
    'Accept': 'application/json',
    },
    );


    I also added the internet permission code but it didn't work.

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <application

    Continue reading...

Compartilhe esta Página