“JCenter 即将报废"android lint 警告,替换是什么?

quot;JCenter is at end of lifequot; android lint warning, what is the replacement?(“JCenter 即将报废android lint 警告,替换是什么?)
本文介绍了“JCenter 即将报废"android lint 警告,替换是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

Android Studio Arctic Fox Canary 8 开始警告 JCenter 生命周期结束

Android Studio Arctic Fox Canary 8 started to warn that JCenter is at end of life

但我不能只删除 jcenter() 声明,因为它承载了很多 android 工件,它会导致 Could not resolve all artifacts 错误.解决此警告的正确方法是什么?

But I cannot just delete jcenter() declarations since it hosts a lot of android artifacts, it would lead to Could not resolve all artifacts error. What is the right way to solve this warning?

推荐答案

有一个描述问题的文档部分:JCenter 弃用和服务终止.您可以通过展开检查说明 (Ctrl+F1) 找到该链接.文档指出:

There's a documentation section describing the problem: JCenter deprecation and end of service. You can find the link by expanding the inspection description (Ctrl+F1). The documentation states:

JFrog,维护许多 Android 项目使用的 JCenter 工件存储库的公司,最近宣布了 JCenter 的弃用和即将退役.根据公告,JCenter 将允许在 2022 年 2 月 1 日之前下载现有工件.

JFrog, the company that maintains the JCenter artifact repository used by many Android projects, recently announced the deprecation and upcoming retirement of JCenter. According to the announcement, JCenter will allow downloads of existing artifacts until February 1, 2022.

在 JCenter 上发布工件的开发人员应该开始将他们的包迁移到新主机,例如作为 Maven 中心.

Developers who publish artifacts on JCenter should start migrating their packages to a new host, such as Maven Central.

在不久的将来,我们将提供有关将 Android 项目从此页面上的 JCenter.

In the near future, we will provide additional information about migrating Android projects away from JCenter on this page.

扩展的检查描述(以及上面的文档)建议将 jcenter() 替换为 mavenCentral().实际上 JCenterMaven Central 的超集,但是在您的项目使用的所有 JCenter 工件都被移动之前,这样的替换不会解决问题到 Maven 中心.

The expanded inspection description (as well as the documentation above) suggests to replace jcenter() by mavenCentral(). Acually JCenter is a superset of Maven Central, but such a replacement won't resolve the problem until all JCenter artifacts your project uses will be moved to Maven Central.

我认为最佳解决方案是等到您正在使用的库从 jcenter() 移出并尝试用 mavenCentral() 替换它.如果仍然缺少某些工件,请查看文档,可能它们已移至另一个存储库,您也应该将其添加到 repositories 列表中.

I think the optimal solution would be to wait until the libraries you're using are moved from jcenter() and try to replace it with mavenCentral(). If some artifacts are still missing, take a look at the documentation, may be they are moved into another repository and you should add it to the repositories list as well.

repositories {
    google()

//  jcenter()       // <- removed
    mavenCentral()  // <- added
}

如果您是库作者,您应该迁移到另一个 repo,可能是 Maven Central.请注意,根据 JCenter 弃用公告新的提交只允许在 2021 年 3 月 31 日之前提交.

If you're a library author you should migrate to another repo, probably it would be Maven Central. Note that according to the JCenter deprecation announcement new submissions are allowed only until March 31st 2021.

一些相关资源:

  • jCenter &Bintray 正在关闭.现在呢?
  • 从 JCenter 迁移

这篇关于“JCenter 即将报废"android lint 警告,替换是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Android release APK crash with java.lang.AssertionError: impossible in java.lang.Enum(Android 发布 APK 因 java.lang.AssertionError 崩溃:在 java.lang.Enum 中不可能)
Finished with Non Zero Exit Value 3(以非零退出值 3 结束)
On gradle:3.0.0 More than one file was found with OS independent path #39;META-INF/ASL2.0#39;(在 gradle:3.0.0 上找到多个文件,其独立于操作系统的路径为“META-INF/ASL2.0)
Android : app loading library at runtime on Lollipop but not IceCreamSandwich(Android:运行时在 Lollipop 上而不是 IceCreamSandwich 上的应用程序加载库)
buildConfigField depending on flavor + buildType(buildConfigField 取决于风味 + buildType)
How do I suppress warnings when compiling an android library with gradle?(使用 gradle 编译 android 库时如何抑制警告?)