Migrate to Kotlin coroutines in Android with Kotlin 1.3

后端 未结 4 1256
温柔的废话
温柔的废话 2020-12-10 13:22

What should I change in my build.gradle file or import in classes to use stable coroutine functions in my Android project with Kotlin 1.3 ?

Fragment abo

4条回答
  •  误落风尘
    2020-12-10 14:06

    Simply add "mavenCentral()" to build.gradle bellow build script: I fixed using this.

    buildscript {
        ext.kotlin_version = '1.3.72'
    
        repositories {
            google()
            jcenter()
    
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:4.0.0'
            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() //Add this Line only <<<<<<<<<<<<<<<<<<
        }
    }
    

提交回复
热议问题