android - 从 jcenter 迁移到 maven 出现错误:“无法解决:org.adblockplus:adblock-android-webview:4.4.0”
问题描述
我正在尝试在我的 Android 应用程序中使用它:
https://github.com/adblockplus/libadblockplus-android
bu把它放在我的build.gradle中:
implementation 'org.adblockplus:adblock-android-webview:4.4.0'
如果我jcenter()
在我的 build.gradle 存储库中列出,它工作正常。但我不断收到警告JCenter is at end of life
,所以我试图切换到maven
.
但是当我用 替换jcenter()
时mavenCentral()
,它不起作用并给我错误:
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 无法找到它。
我究竟做错了什么?我对此很陌生,所以对存储库不太熟悉。
解决方案
如果它在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/ )”。
在随附的图片中,您可以看到它们可用的存储库。Adblock 仅存在于 Jcenter 中。而 Apache Commons 仅存在于 Central 而不是 JCenter。
推荐阅读
- php - Laravel query on exact minute
- java - Passing spinner data to other field
- xml -
- javascript - Module not found when new dependency is installed
- android - SQLite 表已删除,新表未创建
- javascript - 谷歌地图标记图标笔画重量动态增加以显示警报
- ruby-on-rails - 我无法使用 haml 和 rails6 运行基本的 rspec 测试
- c - 在函数调用中省略与号
- c# - 将对象添加到列表时,不执行构造函数
- java - 如何从输入中获取默认值到 servlet?