java.net.SocketException: socket failed: EPERM (Operation not permitted) java.net.SocketException: socket failed: EPERM (Operation not permitted) java java

java.net.SocketException: socket failed: EPERM (Operation not permitted)


Solved: All I needed to do was to uninstall the app from the emulator or physical connected device and run it again.


Just uninstall the app from the emulator then run again and it’ll work. I had the same issue

To uninstall the app run your project when "the application had stopped" message appear click "app info" then uninstall.


First of all you need change your android manifest .xmlBut after this action you must uninstall application and run it again.https://developer.android.com/training/basics/network-ops/connecting

and code here:

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

in AndroidManifest.xml