IntelliJ - Android Project - Gradle Update Failed

I am using IntelliJ IDEA 2016.2 for Windows 7 (64-bit).

I created a project (with MainActivity). At the time of creation, gradle was “refreshing,” and then it failed.

Gradle MyApp update failed. Error: connection timeout: connect. If you are behind an HTTP proxy, configure the proxy settings in either the IDE or Gradle.

I do not use proxies. And yet I tried to add the following code to Gradle.properties:

systemProp.http.proxyHost=127.0.0.1
systemProp.http.proxyPort=8080
systemProp.https.proxyHost=127.0.0.1
systemProp.https.proxyPort=8080

After the update, the error was:

Gradle MyApp update failed. Error: connection rejected: connect

In the IDE settings (Build, Execution, Deployment → Build Tools → Gradle) I tried to change the default setting (I found this on the Internet) from “Use default gradle wrapper” to “Use local gradle distribution”, and in “Gradle home” after booting, I put the home directory on "Gradle 2.10". I tried even with "Gradle 2.14". After that, I tried the "Offline work" setting (in the same settings area) →, and this gave me the following:

Gradle sync error Project error "MyApp": no cached version of com.android.tools.build:gradle:2.1.0 is available for offline mode. Disable gradle "offline" and project synchronization

All this and it still does not work.

I mention that I have java (jdk1.8.0_31) and SDK Manager installed.

Android Studio, gradle Building (, , ). "My First Android App".

IntelliJ gradle?

+4
1

Android Studio:

→ / " ".

enter image description here

0

Source: https://habr.com/ru/post/1648157/


All Articles