本文介绍了jcenter死后哪个maven存储库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以昨天我将我的 android studio 更新到最新版本 (4.2),在构建我的项目后我收到了这个警告

so yesterday I updated my android studio to the newest version (4.2) and after building my project I got this warning

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 'Personal Dictionary', project ':app'

那么我应该使用什么存储库?

so what repository should I use instead?

推荐答案

这取决于您的依赖项的托管位置.并非所有的库都从 jcenter 迁移出来.通常,mavenCentral 似乎是最受欢迎的存储库.

It depends on where your dependencies are hosted. Not all libraries are yet migrated off jcenter yet. Generally, mavenCentral seems to be the most popular repo.

您可以在 build.gradle 文件中注释掉 jcenter,使用 --refresh-dependencies 命令行选项调用 gradle build,然后查看构建是否在某处失败.您可以使用 mvnrepository 服务来尝试为您的依赖项查找其他存储库.

You can comment out jcenter in your build.gradle file, invoke gradle build with --refresh-dependencies command line option and see if the build is failing somewhere. You can use mvnrepository service to try to find other repos for your dependencies.

如果仍然存在仅在 jcenter 中的依赖项,您可以限制 gradle 仅使用该存储库中的特定依赖项:

If there are still dependencies that are only in jcenter, you can restrict gradle to only use that specific dependency from that repo:

jcenter() {
    content {
        includeModule("<group id>", "<artifact id>")
    }
}

这篇关于jcenter死后哪个maven存储库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-13 11:18