title: Android Studio Internet Permission
body: <p>I decided migrate my application from eclipse to android studio, but when I run it's throwing the SecurityException with permission denied, and suggest I'm missing the internet permission in AndroidManifest.xml.</p>
  
  <p>But the permission is on it. And I can't figured out how to fix it.</p>
  
  <p>My AndroidManifest</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="br.com.brmobile.boo"&gt;
  
      &lt;uses-permission android:name="android.permission.INTERNET"/&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /&gt;
      &lt;uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" /&gt;
      &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /&gt;
  
      &lt;application
          android:name=".application.AppController"
          android:allowBackup="true"
          android:icon="@drawable/ic_launcher"
          android:label="@string/app_name"
          android:theme="@style/AppTheme"&gt;
  
  
          &lt;activity
              android:name=".activities.Splash"
              android:label="@string/title_activity_splash"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>The stacktrace:</p>
  
  <pre><code>java.lang.SecurityException: Permission denied (missing INTERNET permission?)
              at java.net.InetAddress.lookupHostByName(InetAddress.java:418)
              at java.net.InetAddress.getAllByNameImpl(InetAddress.java:236)
              at java.net.InetAddress.getAllByName(InetAddress.java:214)
              at com.android.okhttp.internal.Dns$1.getAllByName(Dns.java:28)
              at com.android.okhttp.internal.http.RouteSelector.resetNextInetSocketAddress(RouteSelector.java:216)
              at com.android.okhttp.internal.http.RouteSelector.next(RouteSelector.java:122)
              at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:292)
              at com.android.okhttp.internal.http.HttpEngine.sendSocketRequest(HttpEngine.java:255)
              at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:206)
              at com.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:345)
              at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:296)
              at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:503)
              at com.android.volley.toolbox.HurlStack.performRequest(HurlStack.java:109)
              at com.android.volley.toolbox.BasicNetwork.performRequest(BasicNetwork.java:93)
              at com.android.volley.NetworkDispatcher.run(NetworkDispatcher.java:110)
       Caused by: libcore.io.GaiException: getaddrinfo failed: EAI_NODATA (No address associated with hostname)
              at libcore.io.Posix.getaddrinfo(Native Method)
              at libcore.io.ForwardingOs.getaddrinfo(ForwardingOs.java:61)
              at java.net.InetAddress.lookupHostByName(InetAddress.java:405)
              at java.net.InetAddress.getAllByNameImpl(InetAddress.java:236)
              at java.net.InetAddress.getAllByName(InetAddress.java:214)
              at com.android.okhttp.internal.Dns$1.getAllByName(Dns.java:28)
              at com.android.okhttp.internal.http.RouteSelector.resetNextInetSocketAddress(RouteSelector.java:216)
              at com.android.okhttp.internal.http.RouteSelector.next(RouteSelector.java:122)
              at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:292)
              at com.android.okhttp.internal.http.HttpEngine.sendSocketRequest(HttpEngine.java:255)
              at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:206)
              at com.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:345)
              at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:296)
              at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:503)
              at com.android.volley.toolbox.HurlStack.performRequest(HurlStack.java:109)
              at com.android.volley.toolbox.BasicNetwork.performRequest(BasicNetwork.java:93)
              at com.android.volley.NetworkDispatcher.run(NetworkDispatcher.java:110)
       Caused by: libcore.io.ErrnoException: getaddrinfo failed: EACCES (Permission denied)
              at libcore.io.Posix.getaddrinfo(Native Method)
              at libcore.io.ForwardingOs.getaddrinfo(ForwardingOs.java:61)
              at java.net.InetAddress.lookupHostByName(InetAddress.java:405)
              at java.net.InetAddress.getAllByNameImpl(InetAddress.java:236)
              at java.net.InetAddress.getAllByName(InetAddress.java:214)
              at com.android.okhttp.internal.Dns$1.getAllByName(Dns.java:28)
              at com.android.okhttp.internal.http.RouteSelector.resetNextInetSocketAddress(RouteSelector.java:216)
              at com.android.okhttp.internal.http.RouteSelector.next(RouteSelector.java:122)
              at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:292)
              at com.android.okhttp.internal.http.HttpEngine.sendSocketRequest(HttpEngine.java:255)
              at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:206)
              at com.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:345)
              at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:296)
              at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:503)
              at com.android.volley.toolbox.HurlStack.performRequest(HurlStack.java:109)
              at com.android.volley.toolbox.BasicNetwork.performRequest(BasicNetwork.java:93)
              at com.android.volley.NetworkDispatcher.run(NetworkDispatcher.java:110)
  </code></pre>