Reason 1 -> java.net.socketexception: socket failed: eperm operation not permitted
[ socket failed EPERM Operation not permitted ] The first place to look for the cause may be to check the file AndroidManifest.xml. Make sure you add permission:
<uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
Reason 2
If you still get this error despite adding the above permissions, then uninstall the application from Emulator and then run again the application from Android Studio.
If you enjoyed this post please add the comment below and share this post on your Facebook, Twitter, LinkedIn or another social media webpage.
Thanks in advanced!
Worked!
I am glad to hear that! 🙂