Flutter API calls on android device are not working

Viewed 1085

I am developing an app with flutter. API calls on android device is not working.

API calls working fine with iOS and android simulators and iPhone, but not working with android real devices.

I have added the permission too

android/app/src/main/AndroidManifest.xml
<uses-permission android:name="android.permission.INTERNET"/>

enter image description here

I am getting the following error

[ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: SocketException: Connection failed (OS Error: Network is unreachable, errno = 101), address = fidhappy.com, port = 443

enter image description here

But if i turn on wifi on android device. the api calls are working. its not working with mobile data.

Please help me to solve this issue.

Thanks

0 Answers
Related