How can I upgrade Kotlin version from 1.2.51 to 1.3 on Android Studio

14,036

Solution 1

Thanks to yole and TheWanderer I found what was missing.

Here under the EAP-NEXT tab you can find the correct version of the kotlin plugin for IntelliJ/Android Studio.

So this is what I did to solve it:

1 - Android Studio -> Tools -> Kotlin -> Configure Kotlin Plugin Updates 2 - Select Early Access Preview 1.3 on the Update channel drop down(If you can't find it click again) 3 - What this answer says: On your project level build.gradle:

buildscript {
  repositories {
    maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' }
  }
}

repositories {
  maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' }
}

Solution 2

To update to a prerelease version of Kotlin, as described in the blog post, you need to add the kotlin-eap repository to your build.gradle:

buildscript {
  repositories {
    maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' }
  }
}

repositories {
  maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' }
}

Solution 3

org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.7

Doesn't exist. The plugin versions use trailing zeros, so it would be:

org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.70

However, 1.2.71 is currently the latest, so I recommend using that instead.

https://mvnrepository.com/artifact/org.jetbrains.kotlin/kotlin-gradle-plugin

Share:
14,036
Aerim
Author by

Aerim

Android developer

Updated on June 22, 2022

Comments

  • Aerim
    Aerim almost 2 years

    I'm having some trouble upgrading the version of Kotlin to 1.3-M1 or 1.3-M2

    I'm using 1.2.51 right now and the error I'm getting when I try using any newer versions like 1.3-M2 is:

    Could not find org.jetbrains.kotlin:kotlin-gradle-plugin:1.3-M2.

    I'm guessing it has been moved but I've looked al over and haven't found a solution.

    Can anyone point me in the right direction?

  • Aerim
    Aerim over 5 years
    Sorry, the question was kind of miss leading, I'm actually trying to update to a 1.3.+ version
  • TheWanderer
    TheWanderer over 5 years
  • TheWanderer
    TheWanderer over 5 years
    Kotlin 1.3 may be released, but there is no Kotlin 1.3 plugin for IntelliJ yet.
  • yole
    yole over 5 years
    There most definitely is one. plugins.jetbrains.com/plugin/6954-kotlin/update/50621 for example.
  • Aerim
    Aerim over 5 years
    I had actually seen that post and tried that but on the wrong gradle file
  • Aerim
    Aerim almost 5 years
    This is an old question and I was working with unreleased versions of Kotlin.