Home android Gradle sync failed

Gradle sync failed




Help, please !!!
Every time I start Intelij IDEA, I get the same error:

Gradle sync failed: Failed to find target with hash string ‘android-26’ in: C: \ Users \ RooT \ AppData \ Local \ Android \ Sdk
Consult IDE log for more details (Help | Show Log)

Also underlines the code in red …
enter image description here

Answer 1, authority 100%

Just download the SDK for API Level 26 from Android SDK Manager . The error is related to the lack of a platform, not a lack of any tool.

 enter image description here

 enter image description here

Answer 2

You need to specify the path to the JDK in the JAVA_HOME variable. For example, I have C: \ Program Files \ java \ jdk1.8.0_31 .

Answer 3

According to dock any support is now downloaded from outside the SDK , but from the google repository. Those. it may help to specify its address in the build.gradle project level:

allprojects {
  repositories {
    maven {url "https://maven.google.com"}

Answer 4

https://www.jetbrains.com/help/education /troubleshooting-guide.html#outside_of_known_port_range :

Windows Firewall

  1. Open Windows Firewall .

  2. Go to Advanced Settings .

  3. Right-click Inbound Rules and select New Rule ….

  4. Select Port .

  5. Enter a port range that is used by your IDE of choice, in this case it’s 63342-63362 .

  6. Allow the connection.

  7. Restart your system.

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions