Skip to content Skip to sidebar Skip to footer

My Ionic App Can't Access My Local Node Server From Android Emulator

I'm trying to run for the first time my React/Ionic app on an Android Emulator using Capacitor. The app should connect to my local Node server using Axios. While my app started suc

Solution 1:

After searching, I found the solution in another SO question :

  • The problem comes from the fact the my app uses http instead of https requests which Android forbids by default, starting with API level 28.

To allow http requests, I added android:usesCleartextTraffic="true" to my app's AndroidManifest.xml

Reference: https://developer.android.com/guide/topics/manifest/application-element#usesCleartextTraffic

Solution 2:

if you use instances on cloud, modify host file, on linux the rute is : /etc/hosts

add this line:

localhost < ip-public-your-instance >

Post a Comment for "My Ionic App Can't Access My Local Node Server From Android Emulator"