Android emulator connecting to is not working

Lots of android developers test their android app from the local server. Generally, they use a different type of android library, for example, Volley library to connect the app with localhost. Android emulator support to connect localhost.

Sometimes developers face some connecting issue with localhost whenever they make a request to server i.e HTTP traffic to not permitted

But if we try to send an HTTP request to other URLs except, it is working fine, no problem there.

Generally, is for localhost, but in the case of an android emulator, it uses as localhost.

So how to fix HTTP traffic to not permitted?

So we need to add one more line to our Android manifest file i.e


This usesCleartextTraffic attribute introduced by Android 6.0 (Marshmallow). By default, this attribute value is false. We need to set it to true from the manifest file. So here is what the code looks like.

<?xml version="1.0" encoding="utf-8"?>
<manifest ...>
    <uses-permission android:name="android.permission.INTERNET" />
About Ashis Biswas

A web developer who has a love for creativity and enjoys experimenting with the various techniques in both web designing and web development. If you would like to be kept up to date with his post, you can follow him.

Leave a Comment