SocketException: Permission Denied?

后端 未结 2 1810
温柔的废话
温柔的废话 2021-02-06 21:00

My LogCat reads:

08-19 09:29:01.964: WARN/System.err(311): java.net.SocketException: Permission denied
08-19 09:29:02.204: WARN/System.err(311):     at org.apach         


        
相关标签:
2条回答
  • 2021-02-06 21:23

    You need to go to your Manifest file in your android application project then above application section next to other permissions add: android.permission.INTERNET

    Your manifest should look something like this:

    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    android:versionCode="1"
    android:versionName="1.0" >
    
    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="18" />
    ....
    <uses-permission android:name="android.permission.INTERNET" />
    ...
    <application
    android:allowBackup="true"
    ....
    

    keep in mind value (android.permission.INTERNET) is case sensitive.

    Hope this saves you some time.

    0 讨论(0)
  • 2021-02-06 21:41

    Add Internet permission to your manifest:

    <uses-permission android:name="android.permission.INTERNET"/>
    
    0 讨论(0)
提交回复
热议问题