title: Android Studio 3.1.2 Connection Reset
body: <p>After installing Android Studio 3.1.2 for the first time on his Windows 7 corporate laptop and loading a default project, the user discovers that studio will not properly Gradle Sync. This occurs when gradle attempts to download the Android Studio gradle plugin 3.1.2 as a part of the Configure Project subtask. The error displays as connection reset after spending a long time attempting to download the plugin from several repositories.</p>
  
  <p>Visual display of the problem:</p>
  
  <p><a href="https://i.stack.imgur.com/BbQj8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BbQj8.png" alt="enter image description here"></a></p>
  
  <p>Android Studio had previously downloaded gradle 4.4 itself with no issues, so that suggests that Android Studio has internet connectivity and the proper rights within the gradle home directory which is located in the default location (i.e the users folder). Deleting the .gradle folder and letting Android Studio redownload it is always successful, but never helpful (<a href="https://stackoverflow.com/questions/45669613/android-studio-failed-to-configure-project">Common solution for project configuration</a>).</p>
  
  <p>Switching between using internal JRE and external JDK (java 1.8) does not result in any changes. Gradle is not running offline. Running the gradle wrapper from commandline results in the same problems. Pointing to an external gradle distribution (in this case I pointed to gradle 4.7) does not seem to help. All other settings are defaults. Permissions do not seem to be the problem since the same problems crop up when running android studio in admin mode. Invalidating the cache and restarting the application is unhelpful.</p>
  
  <p>A common solution mentioned by other users for synch problems is to add alternative repos to the gradle build file. This solution has no success for this particular problem.</p>
  
  <p>The simple gradle build file:</p>
  
  <p><a href="https://i.stack.imgur.com/2xJuD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2xJuD.png" alt="enter image description here"></a></p>
  
  <p>Another solution mentioned by other users is to alter proxy settings. Given that the laptop is of corporate origin, this might make some sense. Unfortunately, given that android studio is able to download gradle by itself, this does not seem to be the case. Also if proxying was the issue, a different connection failure message would likely appear (<a href="https://stackoverflow.com/questions/36330895/gradle-sync-failed-connection-refused">Proxy Problems Solution</a>).</p>
  
  <p>Has anyone experienced this problem, and do you have a solution to get android studio synching successfully?</p>