舒心、快乐,比什么都重要

AndroidStudio 集成kotlin,以及Kotlin-gradle-plugin-1.5.0.jar 下载失败

配置Kotlin

buildscript {
    ext.kotlin_version = '1.5.0'

    repositories {

        maven{url 'http://maven.aliyun.com/nexus/content/groups/public/'}
        google()
        mavenCentral()
    }
    dependencies {
        classpath "com.android.tools.build:gradle:4.2.1"

        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        mavenCentral()
//        jcenter() // Warning: this repository is going to shut down soon

        maven{url 'http://maven.aliyun.com/nexus/content/groups/public/'}
    }
}

 

app build.Gradle 

引用最新包

    implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"

 

网络不好,所以我把jcenter()换成了阿里云的包

这样就能吧kotlin引入到工程

 

posted @ 2022-05-13 13:27  Arcturis  阅读(739)  评论(0编辑  收藏  举报