Socket.io: Socket IO is not connected wen using android Pie/android 9

Created on 15 Jan 2019  路  13Comments  路  Source: socketio/socket.io

I have issue where android 9 is not connecting to my socket io. Please help

Most helpful comment

you must add this code in application tag
like below
<Application . . android:usesCleartextTraffic="true"> . . . <Application/>

This problem is cause that Android emulator doesn't see "localhost" url. You need to put your local IP. (for macOS, you can learn yours by writing ifconfig). I solved it with way.

All 13 comments

same issue ..
It's working below Pie ...

u could open the socket.io server Debug model. and it will show some information. and upload on here. we can help u check what happen.

DEBUG=* node xxx.js

i set below code in my android manifest project and it work fine for me

android:usesCleartextTraffic="true"

i set below code in my android manifest project and it work fine for me

android:usesCleartextTraffic="true"

Exactly where did you put it?

you must add this code in application tag
like below
<Application . . android:usesCleartextTraffic="true"> . . . <Application/>

you must add this code in application tag
like below
<Application . . android:usesCleartextTraffic="true"> . . . <Application/>

This problem is cause that Android emulator doesn't see "localhost" url. You need to put your local IP. (for macOS, you can learn yours by writing ifconfig). I solved it with way.

i used android:usesCleartextTraffic="true" but again not connecting on android 9.
everything is ok on my other device with android 8

Same here. If I build my App with SDK 27 it works flawlessly. If I build it using sdk 28 it does not connect. Now Play Store only accepts apps and apps updades with build sdk 28... Any fixes for this? Already tried android:usesCleartextTraffic="true", no success

you must add this code in application tag
like below
<Application . . android:usesCleartextTraffic="true"> . . . <Application/>

This problem is cause that Android emulator doesn't see "localhost" url. You need to put your local IP. (for macOS, you can learn yours by writing ifconfig). I solved it with way.

It works! Thank you. I didn't even put android:usesCleartextTraffic="true" setting to manifest.xml.

you must add this code in application tag
like below
<Application . . android:usesCleartextTraffic="true"> . . . <Application/>

This problem is cause that Android emulator doesn't see "localhost" url. You need to put your local IP. (for macOS, you can learn yours by writing ifconfig). I solved it with way.

It works! Thank you. I didn't even put android:usesCleartextTraffic="true" setting to manifest.xml.

You're welcome.

Adding usesCleartextTraffic worked for me. Thanks!!

you must add this code in application tag
like below
<Application . . android:usesCleartextTraffic="true"> . . . <Application/>

Thanks, It worked for me

It seems the usesCleartextTraffic attribute now defaults to false starting from SDK 28 (ref).

A few solutions are mentioned here: https://stackoverflow.com/a/50834600.

Let's close this, as I don't think we can do much here.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MyMomSaysIAmSpecial picture MyMomSaysIAmSpecial  路  4Comments

adammw picture adammw  路  4Comments

kootoopas picture kootoopas  路  4Comments

distracteddev picture distracteddev  路  3Comments

karmac2015 picture karmac2015  路  3Comments