Android Studio 4.2 - Kotlin version 1.5.0 error and endless loading for suggestions in Project Structure window
Asked Answered
F

3

8

And what does it mean?

enter image description here

enter image description here

I tried to change ext.kotlin_version = '1.5.0' to ext.kotlin_version = '1.5.0-release-764' but in this case gradle project fails to build with Could not find org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.0-release-764.

UPDATE ext.kotlin_version = '1.5.0' - also doesn't work, same error and warning

build.gradle:

buildscript {
    ext.kotlin_version = '1.5.0'

    repositories {
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:4.2.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

allprojects {
    repositories {
        google()
    }
}

gradle-wrapper.properties:

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip

Could not resolve all artifacts for configuration ':classpath'. Could not find org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.0. Searched in the following locations: - https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.5.0/kotlin-gradle-plugin-1.5.0.pom If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.

UPDATE 2

I had to add mavenCentral() to make it work, though warning is still there but it builds

Also another issue if 4.2 version is endless loading for suggestions in Project Structure window after you updated version of one dependency

enter image description here

Feigin answered 6/5, 2021 at 9:36 Comment(3)
Same problem!!!Teenateenage
To me the only change was to change 1.5.0-release-764 with 1.5.0 and it worked. Android Studio 4.2 Build #AI-202.7660.26.42.7322048, built on April 29, 2021. I created a file -> new project "empty activity project" template. Min API 29.Gabbert
Adding mavenCentral worked for me for most the issues.Bullroarer
F
6

They released new version 202-1.5.10-release-894-AS8194.7

Now it works fine without any warning with: ext.kotlin_version = '1.5.10'

Though I didn't check the second issue

endless loading for suggestions in Project Structure window

Feigin answered 26/5, 2021 at 9:46 Comment(3)
1.5.10 did nto work for me, I had to use 1.5.0Bullroarer
@BrillPappin update Kotlin plugin in Android Studio!Feigin
We ended up having to downgrade. We were having too many problems with dependencies,and it just wasn't worth time it was costing us to figure it out.I think we're going to have to wait for the plugins, and other components, to catch up.Bullroarer
P
1

I had this problem recently with version 1.5.10-release-894. So I change to 1.5.10 and now it builds !

buildscript {
    ext.kotlin_version = "1.5.10"
    repositories {
        google()
        mavenCentral()
    }

Also I updated the build.gradle to version 4.2.1

    dependencies {
        classpath "com.android.tools.build:gradle:4.2.1"
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
Perron answered 25/5, 2021 at 20:13 Comment(0)
L
-2

try with " :

ext.kotlin_version = "1.5.0"
repositories {
    google()
    mavenCentral()
}
dependencies {
    classpath "com.android.tools.build:gradle:4.2.0"
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
Leftover answered 6/5, 2021 at 15:46 Comment(3)
what? are you serious?Feigin
yes sadly there is little bug that changes the location of the new update file in server side. btw did it worked ?Leftover
I mean you can't be serious? it has nothing to do with single or double quotes, of course nothing changesFeigin

© 2022 - 2024 — McMap. All rights reserved.