Rectify java.net.SocketException: Permission denied (maybe missing INTERNET  permission) error

By default, permissions for accessing Internet by an Android file are off. If you wish to do the same you may need to add a simple line into the manifest file of your Project. The permission "android.permission.INTERNET" allows applications to open network sockets.

image

You may receive an error like :

WARN/System.err(): java.net.SocketException: Permission denied (maybe missing INTERNET permission)

This error probably comes up when you do not have Internet permissions set in your Android app. So if you do not have permissions set in your manifest file, add the following line in your AndroidMainfest.xml file that can then have access to the internet:

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

Your Android Manifest XML file may look like this once you have added the permission :

<manifest xlmns:android...>
...
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
</manifest>
Compile the project to get it working. 

ImageSource

Leave a Reply

Your email address will not be published. Required fields are marked *