【问题标题】:Migrating from jcenter to maven gives error: "Failed to resolve: org.adblockplus:adblock-android-webview:4.4.0"从 jcenter 迁移到 maven 出现错误:“无法解决:org.adblockplus:adblock-android-webview:4.4.0”
【发布时间】:2021-08-19 05:29:21
【问题描述】:

我正在尝试在我的 Android 应用中使用它:

https://github.com/adblockplus/libadblockplus-android

把它放在我的 build.gradle 中:

implementation 'org.adblockplus:adblock-android-webview:4.4.0'

如果我的 build.gradle 存储库中列出了 jcenter(),它就可以正常工作。但我不断收到警告JCenter is at end of life,所以我试图切换到maven

但是当我用mavenCentral() 替换jcenter() 时,它不起作用并给我错误:

Failed to resolve: org.adblockplus:adblock-android-webview:4.4.0

我可以在这里看到该库在 Maven 上可用:

https://mvnrepository.com/artifact/org.adblockplus/adblock-android-webview/4.4.0

但由于某种原因,Android Studio 无法找到它。

我做错了什么?我对此很陌生,所以对存储库不太熟悉。

【问题讨论】:

  • 您链接的那个页面明确表示该工件仅在 jcenter 上可用。
  • @ianhanniballake 为什么 Maven 会显示它呢? mvnrepository.com/artifact/org.adblockplus/…
  • 那是mvnrepository.com,而不是maven central search。是什么让您认为它们彼此相关?
  • @ianhanniballake 我对此很陌生。所以 Maven 和 Maven Central 是不同的东西?

标签: android maven android-studio gradle jcenter


【解决方案1】:

如果它在https://repo.maven.apache.org/maven2/ 中可用,那么您可以使用mavenCentral()。否则mavenCentral() 中不存在。

https://mvnrepository.com 只是告诉您哪些工件在哪里可用。如果您在https://mvnrepository.com/artifact/org.adblockplus/adblock-android-webview/4.4.0 的底部看到,它会显示“此工件位于 JCenter 存储库 (https://jcenter.bintray.com/)”。

在所附图片中,您可以看到它们可用的 repo。 Adblock 仅存在于 Jcenter 中。而 Apache Commons 仅存在于 Central 而不是 JCenter。

【讨论】:

  • 好的,这就解释了。谢谢。
猜你喜欢
  • 2021-11-17
  • 1970-01-01
  • 2021-07-02
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-11-07
  • 2017-08-31
  • 1970-01-01
相关资源
最近更新 更多