Plugin [id: 'org.jetbrains.kotlin.jvm', version: '1.2.71'] was not found in any of the following sources

Morgoth picture Morgoth · Sep 28, 2018 · Viewed 25.6k times · Source

I have a fresh install of IntelliJ, I created a new kotlin gradle project using the following settings:

Project settings

This produces the following build.gradle.kts, (the exact same file works on my Windows machine):

import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
    kotlin("jvm") version "1.2.71"
}

group = "com.test"
version = "1.0-SNAPSHOT"

repositories {
    mavenCentral()
}

dependencies {
    compile(kotlin("stdlib-jdk8"))
}

tasks.withType<KotlinCompile> {
    kotlinOptions.jvmTarget = "1.8"
}

Which produces this error, when trying to do a gradle refresh:

Plugin [id: 'org.jetbrains.kotlin.jvm', version: '1.2.71'] was not found in any of the following sources:

  • Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
  • Plugin Repositories (could not resolve plugin artifact 'org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.2.71') Searched in the following repositories: Gradle Central Plugin Repository

Answer

Shreck Ye picture Shreck Ye · Oct 22, 2018

Check your Internet connection and make sure your Internet is not restricted.

I solved this problem by turning on proxy for all tunnels (not just HTTP) with a VPN app.