jcenter() is deprecated 解决方法

从谷歌codelabs上克隆的软件,在Android Studio中构建的时候提示:

Please remove usages of jcenter() Maven repository from your build scripts and migrate your build to other Maven repositories.
This repository is deprecated and it will be shut down in the future.
See http://developer.android.com/r/tools/jcenter-end-of-service for more information.
Currently detected usages in: root project ‘**-master’, project ‘:app’

后来发现是jcenter跑路了被停用了。

解决方法
build.gradle: project中使用

1
2
3
4
5
repositories {
google()
mavenCentral()
maven { url 'https://kotlin.bintray.com/kotlinx' }
}

来代替jcenter()的使用。

评论